summaryrefslogtreecommitdiffstats
path: root/lisplib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-06-17 23:01:49 -0700
committerKaz Kylheku <kaz@kylheku.com>2019-06-17 23:01:49 -0700
commit60d79d3d94445b9b27c1b394499995847e889d64 (patch)
tree47bd1e8297dbb949a6322e5a2797d6b3cfd2a6ca /lisplib.c
parent9749c420e5404314f53271d40f1224127b983108 (diff)
downloadtxr-60d79d3d94445b9b27c1b394499995847e889d64.tar.gz
txr-60d79d3d94445b9b27c1b394499995847e889d64.tar.bz2
txr-60d79d3d94445b9b27c1b394499995847e889d64.zip
expander: relax sys:setq and lisp-1 stringency.
The motivation here is that there are behaviors in the expander which hinder symbol-macro-based renaming techniques. For instance (expand '(symacrolet ((x y)) (sys:setq x x))) throws. The right hand side of the setq is fine, but the left hand one is a forbidden symbol macro. Yet, we would just like this to expand to (sys:setq y y). The original idea was that sys:setq occurs as a result of macro-expansion. Therefore, if its argument is a symbol macro, something must be wrong; it didn't get expanded. That reasoning is wrong in the face of explicit expansion techniques that make multiple expansion passes. For instance (set a b) can become something like (sys:setq #:g0005 #:g0007) when the intent that in another round of renaming these gensyms will be defined as symbol macros which perform one more renaming. * eval.c (expand_lisp1_value, expand_lisp1_setq): Macro-expand the symbol and work with the expanded one. We still keep the check for a symbol macro; these situations can arise if a symbol macro cannot expand due to circularity. (do_expand): When checking sys:setq for a bad symbol or symbol macro, work with the expanded argument.
Diffstat (limited to 'lisplib.c')
0 files changed, 0 insertions, 0 deletions