summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-08-07 22:57:49 -0700
committerKaz Kylheku <kaz@kylheku.com>2019-08-07 22:57:49 -0700
commitb82650d684d3aa9ace96b90d832f42d269723a36 (patch)
tree9b62fba464e69ba770ae0919fff1b93141800f89 /eval.c
parent7840f507a485c78607605493e575ff1546245b87 (diff)
downloadtxr-b82650d684d3aa9ace96b90d832f42d269723a36.tar.gz
txr-b82650d684d3aa9ace96b90d832f42d269723a36.tar.bz2
txr-b82650d684d3aa9ace96b90d832f42d269723a36.zip
expander: bugfix: spurious lambda form warning.
* eval.c (do_expand): In the expansion logic for function calls, after we have done the dot-to-apply transform, we must thereafter consistently refer to the new front element of the form insym, and not the original element sym. The first element may be a lambda form moved into the second position by dot-to-apply. We then falsely warn about that being in the operator position. Test case: ((lambda ()) . 3).
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/eval.c b/eval.c
index c45df3bb..f5546b35 100644
--- a/eval.c
+++ b/eval.c
@@ -4867,15 +4867,15 @@ again:
if (consp(insym) && car(insym) == lambda_s) {
insym_ex = expand(insym, menv);
- } else if (!lookup_fun(menv, sym) && !special_operator_p(sym)) {
- if (!bindable(sym))
+ } else if (!lookup_fun(menv, insym) && !special_operator_p(insym)) {
+ if (!bindable(insym))
eval_warn(uw_last_form_expanded(),
- lit("~s appears in operator position"), sym, nao);
+ lit("~s appears in operator position"), insym, nao);
else
eval_defr_warn(uw_last_form_expanded(),
- cons(fun_s, sym),
+ cons(fun_s, insym),
lit("unbound function ~s"),
- sym, nao);
+ insym, nao);
}
if (insym_ex == rcons_s &&