diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2014-08-08 07:50:07 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2014-08-08 07:50:07 -0700 |
commit | 76038c7dbbecd97f4943dcca99deb2d095425fa5 (patch) | |
tree | 78e9d497120e3f210fc8183ca7330660b7a9a93e | |
parent | 508fbb28b53a6dd0d3b4b21cfffe21a4c11e88d0 (diff) | |
download | txr-76038c7dbbecd97f4943dcca99deb2d095425fa5.tar.gz txr-76038c7dbbecd97f4943dcca99deb2d095425fa5.tar.bz2 txr-76038c7dbbecd97f4943dcca99deb2d095425fa5.zip |
Bugfix: ret operator does not generate functions
that take any number of arguments.
* eval.c (me_ret): Generate (op identity (progn @rest <expr>))
rather than of (op identity <expr>).
* txr.1: Update misleading equivalence.
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | eval.c | 4 | ||||
-rw-r--r-- | txr.1 | 5 |
3 files changed, 17 insertions, 2 deletions
@@ -1,3 +1,13 @@ +2014-08-08 Kaz Kylheku <kaz@kylheku.com> + + Bugfix: ret operator does not generate functions + that take any number of arguments. + + * eval.c (me_ret): Generate (op identity (progn @rest <expr>)) + rather than of (op identity <expr>). + + * txr.1: Update misleading equivalence. + 2014-08-07 Kaz Kylheku <kaz@kylheku.com> Version 95. @@ -2539,7 +2539,9 @@ static val me_ido(val form, val menv) static val me_ret(val form, val menv) { - return cons(op_s, cons(identity_s, rest(form))); + return list(op_s, identity_s, cons(progn_s, + cons(list(var_s, rest_s, nao), + rest(form))), nao); } static val me_flet_labels(val form, val menv) @@ -12504,7 +12504,10 @@ and returns the value specified by <form>. The following equivalence holds: - (ret x) <--> (op identity x) + (ret x) <--> (op identity (progn @rest x)) + +where the @rest parameter is mentioned for its side effect of making +op generate a function which accepts any number of arguments. The expression (ret @2) returns a function similar to (lambda (x y . z) y). |