summaryrefslogtreecommitdiffstats
path: root/match.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2011-11-28 09:22:38 -0800
committerKaz Kylheku <kaz@kylheku.com>2011-11-28 09:22:38 -0800
commit8104a2598204df75a485bcb27bd35a2d1c79dc31 (patch)
treefe15a667e4d28af3bd030661c4c1ba71b8a55af7 /match.h
parent92514021697a83be8332457b3dcc437f029ee786 (diff)
downloadtxr-8104a2598204df75a485bcb27bd35a2d1c79dc31.tar.gz
txr-8104a2598204df75a485bcb27bd35a2d1c79dc31.tar.bz2
txr-8104a2598204df75a485bcb27bd35a2d1c79dc31.zip
Added evaluation support for quote and quasiquote with unquotes.
New functions list, append and eval. Code walking framework for expanding quasiquotes. quotes right now. * eval.c (let_s, lambda_s, call_s, cond_s, if_s, and_s, or_s defvar_s, defun_s, list_s, append_s): New symbol variables. (eval_intrinsic, op_quote, expand_forms, expand_cond_pairs, expand_place, expand_qquote): New static functions. (expand): New external function. (eval_init): Initialize new symbol variables. Use newly defined symbol variables to register functions. Also, new functions: quote, append, list and eval. * eval.h (expand): Declared. * lib.c (appendv): New function. (obj_init): quote and splice operator symbols moved into system package. (obj_print, obj_pprint): Support for printing quotes and splices. * lib.h (appendv): Declared. * match.c (do_s): New symbol variable. (syms_init): New variable initialized. (dir_tales_init): New variable used instead of intern. * match.h (do_s): Declared. * parser.y (elem): @(do) form recognized and its argument passed through the new expander. (o_elem, quasi_item): Pass list through expander. (list): Use choose_quote to decide whether to put regular quote or quasiquote on quoted list. (meta_expr): Fixed abstract syntax so the expression is a single argument of the sys:expr, rather than multiple arguments. (unquotes_occur, choose_quote): New static function.
Diffstat (limited to 'match.h')
-rw-r--r--match.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/match.h b/match.h
index e939208f..24afd7c3 100644
--- a/match.h
+++ b/match.h
@@ -24,6 +24,7 @@
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
+val do_s;
void match_init(void);
val match_funcall(val name, val arg, val other_args);
int extract(val spec, val filenames, val bindings);