From 091913bddc128fab2e64cf790e3ee9c3f10ae52f Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 24 Mar 2017 20:08:26 -0700 Subject: bugfix: neglected unbound warnings in DWIM syntax. DWIM expressions like [a b c] are not raising expansion-time warnings about a, b, c being unbound. * eval.c (expand_lisp1): The problem is that here we just return in the case that the symbol is bindable and has no macro expansion! Before returning, we must check whether the symbol has a binding in the variable or function space. If not, raise a warning. --- eval.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/eval.c b/eval.c index 8b2ec9a2..a5e5e45a 100644 --- a/eval.c +++ b/eval.c @@ -2954,6 +2954,10 @@ tail: form = rlcp_tree(symac, form); goto tail; } + if (!lookup_var(menv, form) && !lookup_fun(menv, form)) + eval_defr_warn(last_form_expanded, + cons(var_s, form), + lit("unbound variable/function ~s"), form, nao); return form; } -- cgit v1.2.3