summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-02-03 10:18:15 -0800
committerKaz Kylheku <kaz@kylheku.com>2017-02-03 10:18:15 -0800
commit7ae2ed6eb8720a1b2314da201b18a94862a9804c (patch)
treeef73449fbb7928af06b893601087bc09f84a61b3
parent44366a564c2738f6d9085d828df80f3e4a5a6994 (diff)
downloadtxr-7ae2ed6eb8720a1b2314da201b18a94862a9804c.tar.gz
txr-7ae2ed6eb8720a1b2314da201b18a94862a9804c.tar.bz2
txr-7ae2ed6eb8720a1b2314da201b18a94862a9804c.zip
When expanding sys:lisp1-value, check for bad form.
* eval.c (expand_lisp1_value): If the first argument is an object other than a bindable symbol, throw an error.
-rw-r--r--eval.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/eval.c b/eval.c
index e1431fdf..15adbcaa 100644
--- a/eval.c
+++ b/eval.c
@@ -2077,8 +2077,12 @@ static val expand_lisp1_value(val form, val menv)
val sym = second(form);
val binding_type = lexical_lisp1_binding(menv, sym);
- if (nilp(binding_type))
+ if (nilp(binding_type)) {
+ if (!bindable(sym))
+ eval_error(form, lit("~s: misapplied to form ~s"),
+ first(form), sym, nao);
return form;
+ }
if (binding_type == var_k)
return sym;