From 5f00cc83bdba7ed7b7982030ef34fab35eb4de69 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sun, 1 Jan 2017 09:25:26 -0800 Subject: 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. --- eval.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/eval.c b/eval.c index 0ff18ba0..87224afd 100644 --- a/eval.c +++ b/eval.c @@ -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) { -- cgit v1.2.3