diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-01-18 14:49:47 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-01-18 14:49:47 -0800 |
commit | f659a63f4d436dc60eb74af0040cc573d13dd89b (patch) | |
tree | 70a8160bf65b5a0d19d595229492f7b08df5e11e | |
parent | 24a4f4e1df8c2d00309fde996fdc19434ef5673e (diff) | |
download | txr-f659a63f4d436dc60eb74af0040cc573d13dd89b.tar.gz txr-f659a63f4d436dc60eb74af0040cc573d13dd89b.tar.bz2 txr-f659a63f4d436dc60eb74af0040cc573d13dd89b.zip |
Muffle expansion warning in op macro.
* eval.c (me_op): Install handler to intercept warnings
and route them to uw_muffle_warning.
-rw-r--r-- | eval.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -3278,10 +3278,13 @@ static val supplement_op_syms(val ssyms, val max) static val me_op(val form, val menv) { cons_bind (sym, body, form); + uw_frame_t uw_handler; val new_menv = make_var_shadowing_env(menv, cons(rest_s, nil)); - val body_ex = if3(sym == op_s, + val body_ex = (uw_push_handler(&uw_handler, cons(warning_s, nil), + func_n1v(uw_muffle_warning)), + if3(sym == op_s, expand_forms_lisp1(body, new_menv), - expand(body, new_menv)); + expand(body, new_menv))); val rest_gensym = gensym(lit("rest-")); cons_bind (syms, body_trans, transform_op(body_ex, nil, rest_gensym)); val ssyms = sort(syms, func_n2(lt), car_f); @@ -3291,6 +3294,7 @@ static val me_op(val form, val menv) val has_rest = cons_find(rest_gensym, body_trans, eq_f); val is_op = and3(sym == do_s, consp(body_trans), gethash(op_table, car(body_trans))); + uw_pop_frame(&uw_handler); if (c_num(max) > 1024) eval_error(form, lit("~a: @~a calls for function with too many arguments"), |