summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2018-04-03 06:16:35 -0700
committerKaz Kylheku <kaz@kylheku.com>2018-04-03 06:16:35 -0700
commiteb25dece0352e65855499ca13f01585875693e28 (patch)
tree77e40849f0e186736110d85c80f8294f872b4e81 /eval.c
parent1f6d6acb5b8ed75776249d3032477050ebb92a9a (diff)
downloadtxr-eb25dece0352e65855499ca13f01585875693e28.tar.gz
txr-eb25dece0352e65855499ca13f01585875693e28.tar.bz2
txr-eb25dece0352e65855499ca13f01585875693e28.zip
eval/compile: special ops compile-only & eval-only.
These forms will be specially recognized by the file compiler when they appear as top-level forms. eval-only will mean this: only execute this form (possibly after compiling it); do not emit any compiled code into the output file. compile-only will mean: only emit the compiled code into the output file; do not execute it. * eval.c (eval_init): Register special operators compile-only and eval-only. In the interpreter, these are equivalent to progn and so route to op_progn. * share/txr/stdlib/compiler.tl (compiler compile): Similarly to interpreter, handle compile-only and eval-only as progn.
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index 6880a457..73efc9e3 100644
--- a/eval.c
+++ b/eval.c
@@ -6062,6 +6062,8 @@ void eval_init(void)
reg_op(prof_s, op_prof);
reg_op(switch_s, op_switch);
reg_op(intern(lit("upenv"), system_package), op_upenv);
+ reg_op(intern(lit("compile-only"), user_package), op_progn);
+ reg_op(intern(lit("eval-only"), user_package), op_progn);
reg_mac(defvar_s, func_n2(me_def_variable));
reg_mac(defparm_s, func_n2(me_def_variable));