diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-11-11 21:42:19 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-11-11 21:42:19 -0800 |
commit | 926ad2e614f5c4c817e3ed8b560ded9045a7ccba (patch) | |
tree | ca232f583fd4bca8f9b3b9d89bdb8aab09e42416 /eval.c | |
parent | b5dbbcee80446c28ef8b3c99a5594dd98bdc948a (diff) | |
download | txr-926ad2e614f5c4c817e3ed8b560ded9045a7ccba.tar.gz txr-926ad2e614f5c4c817e3ed8b560ded9045a7ccba.tar.bz2 txr-926ad2e614f5c4c817e3ed8b560ded9045a7ccba.zip |
Bugfix in case{q,ql,qual} macro expansion.
* eval.c (me_case): The key must be quoted unconditionally
whether it's an atom or list. Let's make this subject
to the compatibility flag in case someone's code depends
on it.
* txr.1: Compat notes added.
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 23 |
1 files changed, 17 insertions, 6 deletions
@@ -3157,12 +3157,23 @@ static val me_case(val form, val menv) if (keys == t) eval_error(form_orig, lit("~s: symbol t used as key"), casesym, nao); - ptail = list_collect(ptail, - cons(list(if3(atom(keys), eqfuncsym, memfuncsym), - tformsym, - if3(atom(keys), keys, list(quote_s, keys, nao)), - nao), - forms)); + if (opt_compat && opt_compat <= 156) { + ptail = list_collect(ptail, + cons(list(if3(atom(keys), eqfuncsym, memfuncsym), + tformsym, + if3(atom(keys), + keys, + list(quote_s, keys, nao)), + nao), + forms)); + } else { + ptail = list_collect(ptail, + cons(list(if3(atom(keys), eqfuncsym, memfuncsym), + tformsym, + list(quote_s, keys, nao), + nao), + forms)); + } } if (form && atom(form)) |