From e98581cc2bb7c9f50194f4231d9ed85bd25e93c3 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 7 Aug 2019 22:57:49 -0700 Subject: 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). --- eval.c | 10 +++++----- 1 file 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 && -- cgit v1.2.3