summaryrefslogtreecommitdiffstats
path: root/eval.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-05-18 20:46:23 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-05-18 20:46:23 -0700
commita2d98ba063616fc56c6888641c77b55b562fc9ab (patch)
tree6cf3e0c8a338be5d222ba48b7ffd4ab6165e2960 /eval.h
parentdc791857cfd41fec131d2645409bf6451eb4635b (diff)
downloadtxr-a2d98ba063616fc56c6888641c77b55b562fc9ab.tar.gz
txr-a2d98ba063616fc56c6888641c77b55b562fc9ab.tar.bz2
txr-a2d98ba063616fc56c6888641c77b55b562fc9ab.zip
New feature: self-load-path symbol macro.
* eval.c (self_load_path_s): New symbol variable. (sys_load): Save, set-up and restore self-load-path around load. (set_get_symacro): New function. (eval_init): Register load function using sys_load_s instead of redundant intern. * eval.h (set_get_symacro): Declared. * match.c (v_load): Save, set-up and restore self-load-path macro. * parser.c (load_rcfile): Likewise. * txr.c (txr_main: Set up self-load-path when opening file. * txr.1: Documented self-load-path.
Diffstat (limited to 'eval.h')
-rw-r--r--eval.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/eval.h b/eval.h
index c0cce698..7af95058 100644
--- a/eval.h
+++ b/eval.h
@@ -29,6 +29,7 @@ extern val hash_lit_s, hash_construct_s, struct_lit_s, qref_s;
extern val eval_error_s, if_s, call_s;
extern val eq_s, eql_s, equal_s;
extern val last_form_evaled, last_form_expanded;
+extern val self_load_path_s;
noreturn val eval_error(val ctx, val fmt, ...);
val ctx_form(val obj);
@@ -56,6 +57,7 @@ val func_get_name(val fun, val env);
void reg_varl(val sym, val val);
void reg_var(val sym, val val);
void reg_fun(val sym, val fun);
+val set_get_symacro(val sym, val form);
val apply(val fun, val arglist);
val apply_intrinsic(val fun, val args);
val eval_progn(val forms, val env, val ctx_form);