summaryrefslogtreecommitdiffstats
path: root/parser.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-06-04 07:09:08 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-06-04 07:09:08 -0700
commitfdba421c3b61b5e7c696114f9bc424a25e27d692 (patch)
tree5fc424991dde6d43a12b72504e7665810b612867 /parser.c
parent06352f1874845023738ab9eeb50c5612b1affcb4 (diff)
downloadtxr-fdba421c3b61b5e7c696114f9bc424a25e27d692.tar.gz
txr-fdba421c3b61b5e7c696114f9bc424a25e27d692.tar.bz2
txr-fdba421c3b61b5e7c696114f9bc424a25e27d692.zip
bugfix: do not expand defun body with name in scope.
This is a revert of November 2016 commit 606132c336dbeb0dd8bb851a64c97f2c11b76a85. The commit claims that it fixes a bug, but in fact it introduces one. There is no discussion in that commit about what motivated it. The commit which follows that one introduces a naivey-implemented diagnostic for catching unbound functions at macro-expansion time, so the likely motivation for this wrong fix was to suppress false positives from that naive diagnostic for recursive functions. That has long since been replaced by a better approach. Because of the bug, we cannot do this very useful thing: we cannot write an inline version of a funtion as a macro first, and then a real function which just calls that macro: (defmacro foo (arg) ...) (defun foo (arg) (foo arg)) The bug causes the (foo arg) call in this function not to be expanded, due to the shadowing. * eval.c (do_expand): When expanding defun, do not introduce the function's name as a lexical function binding, because it isn't one.
Diffstat (limited to 'parser.c')
0 files changed, 0 insertions, 0 deletions