diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-01-01 09:25:26 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-01-01 09:30:19 -0800 |
commit | 5f00cc83bdba7ed7b7982030ef34fab35eb4de69 (patch) | |
tree | 41e32d6d715bb34c6aedf8eab6f8b136922e28f2 | |
parent | 0f544070713a7dd93aa759dd71cf02fadd05814c (diff) | |
download | txr-5f00cc83bdba7ed7b7982030ef34fab35eb4de69.tar.gz txr-5f00cc83bdba7ed7b7982030ef34fab35eb4de69.tar.bz2 txr-5f00cc83bdba7ed7b7982030ef34fab35eb4de69.zip |
bugfix: sys:setq bindable check must be warning.
The problem is that during the expansion of something like (do
inc @1), the place expansion will generate a (sys:setq @1 ...)
form which undergoes expansion before the processing which
converts @1 to a gensym. But now that throws an error during
the expansion of the sys:setq form that @1 isn't a bindable
symbol. Since warnings are suppressed during this expansion
phase, we can make it a warning.
* eval.c (not_bindable_warning): New static function.
(do_expand): For the assignment special forms,
throw a warning if the target isn't a bindable symbol,
not an error.
-rw-r--r-- | eval.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -755,6 +755,12 @@ noreturn static val not_bindable_error(val form, val sym) car(form), sym, nao); } +static val not_bindable_warning(val form, val sym) +{ + return eval_warn(form, lit("~s: ~s is not a bindable symbol"), + car(form), sym, nao); +} + static val expand_params_rec(val params, val menv, val macro_style_p, val form, val *pspecials); @@ -3984,7 +3990,7 @@ static val do_expand(val form, val menv) eval_error(form, lit("~s: excess arguments"), sym, nao); if (!bindable(car(args))) - not_bindable_error(form, car(args)); + not_bindable_warning(form, car(args)); } if (form_ex == form && args_ex == args) { |