diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-08-24 05:57:56 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-08-24 05:57:56 -0700 |
commit | eee1e38f9b84618358ea7fa800f12b7a81d1d626 (patch) | |
tree | f824f00c8b91bb718c998759fc10d60517cbca52 /eval.c | |
parent | 95145297d6c1521612b69bf709f1a72879f5672a (diff) | |
download | txr-eee1e38f9b84618358ea7fa800f12b7a81d1d626.tar.gz txr-eee1e38f9b84618358ea7fa800f12b7a81d1d626.tar.bz2 txr-eee1e38f9b84618358ea7fa800f12b7a81d1d626.zip |
Check arg count when expanding defsymacro.
* eval.c (do_expand): Throw error if defsymacro form
isn't a list of three elements, just like defparm
and defparml do.
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -3435,6 +3435,9 @@ static val do_expand(val form, val menv) val init_ex = expand(init, menv); val form_ex = form; + if (sym == defsymacro_s && length(form) != three) + eval_error(form, lit("~s: two arguments expected"), sym, nao); + if (init != init_ex) form_ex = rlcp(cons(sym, cons(name, cons(init_ex, nil))), form); |