summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-01-13 22:34:45 -0800
committerKaz Kylheku <kaz@kylheku.com>2017-01-13 22:34:45 -0800
commit29e448c01f92b1fe54511bdaf5564c774a91cb09 (patch)
treea86c8a5283da6374ace18b895062b3ce0980339e /eval.c
parent0455b347c64dd177036fc79544f3cfb5b3f3118a (diff)
downloadtxr-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.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/eval.c b/eval.c
index 38ba9738..c203186d 100644
--- a/eval.c
+++ b/eval.c
@@ -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);
}