diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2014-02-16 00:32:12 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2014-02-16 00:32:12 -0800 |
commit | c3df6f9980a39f1302b028fa6369ace09db374a2 (patch) | |
tree | 49fbd08fec5ce2bca7d1fdcb55f897031d8d1435 /eval.c | |
parent | 3c5a7595153607497420deacfeef1a2cf31d4687 (diff) | |
download | txr-c3df6f9980a39f1302b028fa6369ace09db374a2.tar.gz txr-c3df6f9980a39f1302b028fa6369ace09db374a2.tar.bz2 txr-c3df6f9980a39f1302b028fa6369ace09db374a2.zip |
* eval.c (expand): Replace blatant tail calls with
a backwards goto.
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -1928,6 +1928,7 @@ val expand(val form) { val macro = nil; +tail: if (atom(form)) { return form; } else { @@ -2063,9 +2064,11 @@ val expand(val form) return form; return rlcp(cons(sym, quasi_ex), form); } else if (sym == gen_s) { - return expand(expand_gen(rest(form))); + form = expand_gen(rest(form)); + goto tail; } else if (sym == delay_s) { - return expand(expand_delay(rest(form))); + form = expand_delay(rest(form)); + goto tail; } else if (sym == op_s || sym == do_s) { return expand_op(sym, rest(form)); } else if (sym == catch_s) { @@ -2086,7 +2089,8 @@ val expand(val form) return form; if (!source_loc(mac_expand)) rlcp(mac_expand, form); - return expand(mac_expand); + form = mac_expand; + goto tail; } else { /* funtion call also handles: progn, prog1, call, if, and, or, |