diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-02-09 15:00:10 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-02-09 15:00:10 -0800 |
commit | 219f2443f6fa50a85d4c29d2a2202f2258b916ac (patch) | |
tree | d2463d1971a5397daff1541caeb73543f9b00b15 | |
parent | 4985d97f85023584640ed45cbfa0d581e675a99f (diff) | |
download | txr-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.c | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -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)) { |