summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-12-07 00:18:36 -0800
committerKaz Kylheku <kaz@kylheku.com>2021-12-07 00:18:36 -0800
commit4534279ab8e0739c8d1b5eab9bdc00b829724e0f (patch)
tree748d60829fe1ddf04e8ad8e4801562858afc3db2
parent2f84ae9bf9176286b7703f3df4370198ce5f60c3 (diff)
downloadtxr-4534279ab8e0739c8d1b5eab9bdc00b829724e0f.tar.gz
txr-4534279ab8e0739c8d1b5eab9bdc00b829724e0f.tar.bz2
txr-4534279ab8e0739c8d1b5eab9bdc00b829724e0f.zip
ret, aret: take one argument, as documented.
* stdlib/op.tl (ret, aret): Simplify implementation, without progn or @rest, or interpolation of multiple args. We use identity* to allow the resulting function to allow and ignore multiple arguments. * txr.1: Strangely, an an edit in commit 99131c676, on Sep 26, 2014, reverted the more accurate equivalence (ret x) <--> (op identity (progn @rest x)) back to the original documentation (ret x) <--> (op identity x) which matched an older implementation. Anyway, that's moot now; the documentation is updated to give the new equivalence via identity*.
-rw-r--r--stdlib/op.tl8
-rw-r--r--txr.14
2 files changed, 6 insertions, 6 deletions
diff --git a/stdlib/op.tl b/stdlib/op.tl
index 723a9008..b348791c 100644
--- a/stdlib/op.tl
+++ b/stdlib/op.tl
@@ -209,11 +209,11 @@
(defmacro ido (. args)
^(ipf (do ,*args)))
-(defmacro ret (. args)
- ^(op identity (progn @rest ,*args)))
+(defmacro ret (arg)
+ ^(op identity* ,arg))
-(defmacro aret (. args)
- ^(ap identity (progn @rest ,*args)))
+(defmacro aret (arg)
+ ^(ap identity* ,arg))
(defun sys:opip-expand (e clauses)
(collect-each ((c clauses))
diff --git a/txr.1 b/txr.1
index f5cecdc0..68f44539 100644
--- a/txr.1
+++ b/txr.1
@@ -55343,7 +55343,7 @@ and
The following equivalence holds:
.verb
- (ret x) <--> (op identity x))
+ (ret x) <--> (op identity* x))
.brev
Thus the expression
@@ -55387,7 +55387,7 @@ and
The following equivalence holds:
.verb
- (aret x) <--> (ap identity x))
+ (aret x) <--> (ap identity* x))
.brev
Thus the expression