summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2018-05-01 20:17:57 -0700
committerKaz Kylheku <kaz@kylheku.com>2018-05-01 20:17:57 -0700
commit771499a17a7d6dcdc962e74201d7ee0ffa8d9f87 (patch)
treef0b2c6e4ab664aa1098c8350512f902a6effb40e /share
parentc56d0c84dfe150f5dfe513be2dd9ce105684404b (diff)
downloadtxr-771499a17a7d6dcdc962e74201d7ee0ffa8d9f87.tar.gz
txr-771499a17a7d6dcdc962e74201d7ee0ffa8d9f87.tar.bz2
txr-771499a17a7d6dcdc962e74201d7ee0ffa8d9f87.zip
interpreter: correct semantics of special var args.
In this patch we eliminate the special operator sys:with-dyn-rebinds, and implement correct semantics for dynamically scoped variables that occur in argument lists. * eval.c (with_dyn_rebinds_s): Symbol variable removed. (bind_args): Handle special variables dynamically: for each symbol that appears, check whether it is a special and treat accordingly by allocating a new dynamic environment if necessary, and binding in that environment. This adds overhead, which is why I moved away from this approach in the past. But now that there is a compiler, overhead in the interpreter matters less. Correct semantics is more important. (expand_params): Greatly simplified for not having to wrap the sys:with-dyn-rebinds operator around the body. (funcall_interp): Since bind_args can now extend the dynamic environment, it is necessary to save and restore dyn_env around it. Another call to bind_args occurs in op_catch; that already saves and restores dyn_env. (op_with_dyn_rebinds): Static function removed. (do_expand): with-dyn-rebinds-s case removed. (eval_init): Removed interning of sys:with-dyn-rebinds symbol and registration of special op. * protsym.c: Regenerated. * compiler.tl (compiler compile): Remove case which handles sys:with-dyn-rebinds.
Diffstat (limited to 'share')
-rw-r--r--share/txr/stdlib/compiler.tl1
1 files changed, 0 insertions, 1 deletions
diff --git a/share/txr/stdlib/compiler.tl b/share/txr/stdlib/compiler.tl
index 4275daf0..2d8962e3 100644
--- a/share/txr/stdlib/compiler.tl
+++ b/share/txr/stdlib/compiler.tl
@@ -320,7 +320,6 @@
(defsymacro me.(compile oreg env (expand-defsymacro form)))
(sys:upenv me.(compile oreg env.up (cadr form)))
(sys:dvbind me.(compile oreg env (caddr form)))
- (sys:with-dyn-rebinds me.(comp-progn oreg env (cddr form)))
(sys:load-time-lit me.(comp-load-time-lit oreg env form))
((macrolet symacrolet macro-time)
(compile-error form "unexpanded ~s encountered" sym))