diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2022-05-12 00:01:57 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2022-05-12 00:01:57 -0700 |
commit | 1162a735b61c1c5086fb6055471ee35cc8ed62a4 (patch) | |
tree | 77dc3b091d2e50f0a6115182a00c2da9d281c1f9 /eval.c | |
parent | 72ea47cb951a774318ab045cf342882cad3ff55d (diff) | |
download | txr-1162a735b61c1c5086fb6055471ee35cc8ed62a4.tar.gz txr-1162a735b61c1c5086fb6055471ee35cc8ed62a4.tar.bz2 txr-1162a735b61c1c5086fb6055471ee35cc8ed62a4.zip |
expander: new rule for macro-produced function calls
* eval.c (do_expand): When a function call's arguments are
expanded and produce a transformation, then if that function
call had been produced by a macro, the transformed function
call is tried again as a macro. This is necessary because
TXR Lisp allows a symbol to be both a function and macro.
When a macro-produced function call's arguments are expanded,
the macro version of that function may, as a result of the
argument transformations, have more opportunities for expansion.
* txr.1: New section outlining how macro expansion generally
works, with a special focus on this unusual new rule.
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -5255,7 +5255,12 @@ again: return form_ex; } - return rlcp(cons(insym_ex, args_ex), form); + form = rlcp(cons(insym_ex, args_ex), form); + if (macro) { + macro = nil; + goto again; + } + return form; } abort(); } |