summaryrefslogtreecommitdiffstats
path: root/genvim.txr
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2014-02-15 17:41:30 -0800
committerKaz Kylheku <kaz@kylheku.com>2014-02-15 17:41:30 -0800
commit53fa77578bcc3cebf491656d3c2e7d07c7493674 (patch)
tree429937531a09627b9eafa0a4cbd20aa3eb25bdcb /genvim.txr
parent5e89795f66750094ccac9d13a1f2001dde3d1226 (diff)
downloadtxr-53fa77578bcc3cebf491656d3c2e7d07c7493674.tar.gz
txr-53fa77578bcc3cebf491656d3c2e7d07c7493674.tar.bz2
txr-53fa77578bcc3cebf491656d3c2e7d07c7493674.zip
First cut at implementation of macros.
* eval.c (top_mb, defmacro_s, macro_time_s, whole_k, env_k): New global variables. (expand_params): Recurse to handle macro parameter lists too. (bind_macro_params, op_defmacro, expand_macro): New static functions. (expand): Evaluate defmacro forms and macro-time forms at expansion time. Recognize and expand macros (albeit not yet with proper lexical scoping: local bindings are not able to shadow a macro). (eval_init): Protect top_mb from GC and initialize it. Intern new symbols defmacro, macro-time, and :whole. Register defmacro operator in op_table. * match.h (env_k): Added declaration for existing external variable.
Diffstat (limited to 'genvim.txr')
0 files changed, 0 insertions, 0 deletions