diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2012-01-09 15:44:50 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2012-01-09 15:44:50 -0800 |
commit | 9fa74517eb0b8252e88f4c636e6e93bca0c9f0be (patch) | |
tree | a14a84ec104a7f625cc9a4c70f2894f8904f2643 /eval.c | |
parent | d8df8beb2e00517a546d753586d67e14ffa4611d (diff) | |
download | txr-9fa74517eb0b8252e88f4c636e6e93bca0c9f0be.tar.gz txr-9fa74517eb0b8252e88f4c636e6e93bca0c9f0be.tar.bz2 txr-9fa74517eb0b8252e88f4c636e6e93bca0c9f0be.zip |
Non-broken way to achieve intent of previous commit.
* eval.c (subst_vars): Do not evaluate modifiers
as an argument list locally. Pass form-evaluating
function to format_field.
* match.c (format_field): Modified to accept new argument,
a one-argument function for reducing a form to a value.
Error checking for invalid modifiers made stricter.
(subst_vars): Do not evaluate modifiers as an argument
list. Pass form-evaluating function to format_field.
* match.h (format_field): Declaration updated.
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -744,7 +744,7 @@ static val subst_vars(val forms, val env) if (sym == var_s) { val sym = second(form); val pat = third(form); - val modifiers = eval_args(fourth(form), env, form); + val modifiers = fourth(form); val pair = lookup_var(env, sym); if (pair) { @@ -756,7 +756,9 @@ static val subst_vars(val forms, val env) if (pat) forms = cons(str, cons(pat, rest(forms))); else if (modifiers) - forms = cons(format_field(str, modifiers, nil), rest(forms)); + forms = cons(format_field(str, modifiers, nil, + curry_123_1(func_n3(eval), env, form)), + rest(forms)); else forms = cons(str, rest(forms)); continue; |