summaryrefslogtreecommitdiffstats
path: root/match.h
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 /match.h
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 'match.h')
-rw-r--r--match.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/match.h b/match.h
index 5b9a84e7..903ab855 100644
--- a/match.h
+++ b/match.h
@@ -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);