summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-02-09 15:00:10 -0800
committerKaz Kylheku <kaz@kylheku.com>2017-02-09 15:00:10 -0800
commit219f2443f6fa50a85d4c29d2a2202f2258b916ac (patch)
treed2463d1971a5397daff1541caeb73543f9b00b15
parent4985d97f85023584640ed45cbfa0d581e675a99f (diff)
downloadtxr-219f2443f6fa50a85d4c29d2a2202f2258b916ac.tar.gz
txr-219f2443f6fa50a85d4c29d2a2202f2258b916ac.tar.bz2
txr-219f2443f6fa50a85d4c29d2a2202f2258b916ac.zip
sys:op: don't warn about @var targets.
* eval.c (do_expand): The previous commit exposes this false warning. Basically, the (sys:var <sym>) place expander generates a (sys:setq (sys:var <sym>) <val>) form. That is valid, and the expander shoud not warn that sys:var form is an unbound variable.
-rw-r--r--eval.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/eval.c b/eval.c
index f3f9cd6f..41c46f64 100644
--- a/eval.c
+++ b/eval.c
@@ -4208,12 +4208,18 @@ static val do_expand(val form, val menv)
if (cddr(args))
eval_error(form, lit("~s: excess arguments"), sym, nao);
- if (!bindable(car(args)))
- not_bindable_warning(form, car(args));
+ {
+ val target = car(args);
- if (car(args_ex) != car(args))
- eval_error(form, lit("~s: misapplied to symbol macro ~a"), sym,
- car(args), nao);
+ if (!consp(target) || car(target) != var_s) {
+ if (!bindable(target))
+ not_bindable_warning(form, car(args));
+
+ if (car(args_ex) != target)
+ eval_error(form, lit("~s: misapplied to symbol macro ~a"), sym,
+ car(args), nao);
+ }
+ }
}
if (!lookup_fun(menv, sym) && !special_operator_p(sym)) {