diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2014-02-15 17:41:30 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2014-02-15 17:41:30 -0800 |
commit | 53fa77578bcc3cebf491656d3c2e7d07c7493674 (patch) | |
tree | 429937531a09627b9eafa0a4cbd20aa3eb25bdcb /match.h | |
parent | 5e89795f66750094ccac9d13a1f2001dde3d1226 (diff) | |
download | txr-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 'match.h')
-rw-r--r-- | match.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -25,7 +25,7 @@ */ extern val text_s, choose_s, gather_s, do_s, require_s; -extern val close_s, load_s, mod_s, modlast_s, counter_k; +extern val close_s, load_s, mod_s, modlast_s, counter_k, env_k; val format_field(val string_or_list, val modifier, val filter, val eval_fun); val match_filter(val name, val arg, val other_args); val match_fun(val name, val args, val input, val files); |