diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-11-11 22:08:33 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-11-11 22:08:33 -0800 |
commit | 37c881d461e55d5c5115c6c6ed397a3df8913fd2 (patch) | |
tree | cd944b1df641c86eea458a14c1d9ab9508a9425d /eval.c | |
parent | 926ad2e614f5c4c817e3ed8b560ded9045a7ccba (diff) | |
download | txr-37c881d461e55d5c5115c6c6ed397a3df8913fd2.tar.gz txr-37c881d461e55d5c5115c6c6ed397a3df8913fd2.tar.bz2 txr-37c881d461e55d5c5115c6c6ed397a3df8913fd2.zip |
Clause in case{q,ql,qual} with no forms yields nil.
* eval.c (me_case): If forms is nil, substitute
the object (nil) for forms, to ensure a nil result
through the expansion to a cond.
* txr.1: Documented and added compat notes.
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -3132,6 +3132,7 @@ static val me_case(val form, val menv) val testform = pop(&form); val tformsym = gensym(lit("test-")); val memfuncsym, eqfuncsym; + val lofnil = cons(nil, nil); list_collect_decl (condpairs, ptail); if (casesym == caseq_s) { @@ -3167,12 +3168,13 @@ static val me_case(val form, val menv) nao), forms)); } else { + uses_or2; ptail = list_collect(ptail, cons(list(if3(atom(keys), eqfuncsym, memfuncsym), tformsym, list(quote_s, keys, nao), nao), - forms)); + or2(forms, lofnil))); } } |