diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2018-03-20 22:03:35 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2018-03-20 22:03:35 -0700 |
commit | 97753bee4c03e02a7cf8605dc4b5c98d556715a9 (patch) | |
tree | 93379248bfac51601972d01f4a2d02b49b5afd57 | |
parent | 51f2b9ee934e4563d80674fcf58e6bd237cdc761 (diff) | |
download | txr-97753bee4c03e02a7cf8605dc4b5c98d556715a9.tar.gz txr-97753bee4c03e02a7cf8605dc4b5c98d556715a9.tar.bz2 txr-97753bee4c03e02a7cf8605dc4b5c98d556715a9.zip |
expander: bugfix: sys:for-op init forms.
* eval.c (do_expand): The first argument of the sys:for-op
special operator isn't "vars" but a sequence of initialization
forms. Name the variable appropriately. The neglected
expansion of these forms is now performed.
-rw-r--r-- | eval.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -4367,20 +4367,23 @@ again: } else if (sym == quote_s || sym == dvbind_s) { return form; } else if (sym == for_op_s) { - val vars = second(form); + val inits = second(form); val cond = third(form); val incs = fourth(form); val forms = rest(rest(rest(rest(form)))); + val inits_ex = expand_forms(inits, menv); val cond_ex = expand_forms(cond, menv); val incs_ex = expand_forms(incs, menv); val forms_ex = expand_progn(forms, menv); - if (cond == cond_ex && incs == incs_ex && forms == forms_ex) { + if (inits == inits_ex && cond == cond_ex && + incs == incs_ex && forms == forms_ex) + { return form; } else { - return rlcp(cons(sym, cons(vars, cons(cond_ex, - cons(incs_ex, - forms_ex)))), form); + return rlcp(cons(sym, cons(inits_ex, cons(cond_ex, + cons(incs_ex, + forms_ex)))), form); } } else if (sym == dohash_s) { val spec = second(form); |