diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2014-02-23 17:57:20 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2014-02-23 17:57:20 -0800 |
commit | a313d780ec41e52ad9b20842e56c553af6eb1a47 (patch) | |
tree | 68eff8a35c0adf3c7234694330d256717ec8de92 /stream.c | |
parent | 3e90887df08f70beb2752e5e3a1e9bebfa93ea2c (diff) | |
download | txr-a313d780ec41e52ad9b20842e56c553af6eb1a47.tar.gz txr-a313d780ec41e52ad9b20842e56c553af6eb1a47.tar.bz2 txr-a313d780ec41e52ad9b20842e56c553af6eb1a47.zip |
Get special variable overriding working in function and macro
parameter lists.
There is a bugfix here too (see eval_init below).
* eval.c (special_s): New global variable. This symbol is used
as a marker in parameter lists denoting expander-generating
syntax that gives information about specials.
(lookup_var, looup_var_l): Bugfix: walk the dynamic chain properly.
Fallback from the lexical chain to the dynamic.
(env_vbind_special): New static function.
(bind_args, bind_macro_params): Detect special list in params. Use
env_vbind_special to bind variables either in the dynamic environment
or the lexical one.
(expand_opt_params, expand_params): Renamed to expand_opt_params_rec
and expand_params_rec, respectively. Now take extra argument for
accumulating list of special variables found in the param list.
(expand_params): New static function.
(set_dyn_env): New static function.
(interp_fun, expand_macro): Set up and tear down new dynamic
environment around parameter list evaluation and body evaluation. This
will take any new dynamic bindings.
(bindings_helper, op_each): The special_s symbol is now used instead of
colon_k for marking specials.
(op_defun): Recognize the specials added to the parameter list
so as not to t report that as not a bindable symbol.
(op_catch): Set up an tear down new dynamic environment around
the evaluation of the catch clause param binding and body.
(expand_vars): use colon_s symbol instead of colon_k for marking
special var.
(eval_init): Bugfix: gc-protect recently added dyn_env variable.
Intern special symbol into special_s variable.
Diffstat (limited to 'stream.c')
0 files changed, 0 insertions, 0 deletions