diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-01-13 22:34:45 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-01-13 22:34:45 -0800 |
commit | 29e448c01f92b1fe54511bdaf5564c774a91cb09 (patch) | |
tree | a86c8a5283da6374ace18b895062b3ce0980339e /eval.c | |
parent | 0455b347c64dd177036fc79544f3cfb5b3f3118a (diff) | |
download | txr-29e448c01f92b1fe54511bdaf5564c774a91cb09.tar.gz txr-29e448c01f92b1fe54511bdaf5564c774a91cb09.tar.bz2 txr-29e448c01f92b1fe54511bdaf5564c774a91cb09.zip |
bugfix: diagnose dotted form calls consistently.
* eval.c (do_expand): Warn about unbound functions
or non-bindable symbols in function position
regardless whether the form is a dotted form
that was subject to the apply transformation.
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 26 |
1 files changed, 13 insertions, 13 deletions
@@ -4079,22 +4079,22 @@ static val do_expand(val form, val menv) not_bindable_warning(form, car(args)); } - if (form_ex == form && args_ex == args) { - if (!lookup_fun(menv, sym) && !special_operator_p(sym)) { - if (!bindable(sym_ex)) - eval_warn(last_form_expanded, - lit("~s appears in operator position"), sym, nao); - else - eval_defr_warn(last_form_expanded, - cons(fun_s, sym), - lit("unbound function ~s"), - sym, nao); - } - return form; + if (!lookup_fun(menv, sym) && !special_operator_p(sym)) { + if (!bindable(sym)) + eval_warn(last_form_expanded, + lit("~s appears in operator position"), sym, nao); + else + eval_defr_warn(last_form_expanded, + cons(fun_s, sym), + lit("unbound function ~s"), + sym, nao); } - if (args_ex == args) + if (args_ex == args) { + if (form_ex == form) + return form; return form_ex; + } return rlcp(cons(sym_ex, args_ex), form); } |