diff options
-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). |