summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-11-29 09:40:08 -0800
committerKaz Kylheku <kaz@kylheku.com>2015-11-29 09:40:08 -0800
commit25e4dce91bd88e97ba1620ad604fb98abff8a009 (patch)
tree020d58709560e57f00b540d8dfbe0de57d71cedf /eval.c
parent24b5694c9fe7437322e09929527d98c7bee1408a (diff)
downloadtxr-25e4dce91bd88e97ba1620ad604fb98abff8a009.tar.gz
txr-25e4dce91bd88e97ba1620ad604fb98abff8a009.tar.bz2
txr-25e4dce91bd88e97ba1620ad604fb98abff8a009.zip
Improve destructuring error messages.
* eval.c (bind_macro_params): On mismatch between atom and param list, or insufficient parameters for list, report which params are mismatched. In a nested destructuring syntax, it is difficult to know.
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/eval.c b/eval.c
index 25a099fa..a1f9a77c 100644
--- a/eval.c
+++ b/eval.c
@@ -920,14 +920,14 @@ static val bind_macro_params(val env, val menv, val params, val form,
if (form) {
if (loose_p == colon_k)
goto nil_out;
- eval_error(ctx_form, lit("~s: atom ~s not matched by parameter list"),
- car(ctx_form), form, nao);
+ eval_error(ctx_form, lit("~s: atom ~s not matched by params ~s"),
+ car(ctx_form), form, params, nao);
}
if (!optargs) {
if (!loose_p)
- eval_error(ctx_form, lit("~s: insufficient number of arguments"),
- car(ctx_form), nao);
+ eval_error(ctx_form, lit("~s: missing arguments for params ~s"),
+ car(ctx_form), params, nao);
if (loose_p == colon_k)
goto nil_out;
}