summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-03-24 20:08:26 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-03-24 20:08:26 -0700
commitd564ec02758e3347d32cbda519ab9a0ccfdc5806 (patch)
tree55e1e253a72674513db65c7fa7c784a9ac862421
parentd6d59c5551a16b5d81779de29e80ffa1065a4275 (diff)
downloadtxr-d564ec02758e3347d32cbda519ab9a0ccfdc5806.tar.gz
txr-d564ec02758e3347d32cbda519ab9a0ccfdc5806.tar.bz2
txr-d564ec02758e3347d32cbda519ab9a0ccfdc5806.zip
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.
-rw-r--r--eval.c4
1 files changed, 4 insertions, 0 deletions
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;
}