summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-06-28 11:47:13 -0700
committerKaz Kylheku <kaz@kylheku.com>2020-06-28 11:47:13 -0700
commit931ee402f18da5c2eeeefb5d6f1217c833e04508 (patch)
tree7f7331a7e3484faa9a13c530b87c6aa4df4c765d /txr.1
parenta6a7e5ea61164c2f721fa353c578aeb2688f04a3 (diff)
downloadtxr-931ee402f18da5c2eeeefb5d6f1217c833e04508.tar.gz
txr-931ee402f18da5c2eeeefb5d6f1217c833e04508.tar.bz2
txr-931ee402f18da5c2eeeefb5d6f1217c833e04508.zip
New function: maprodo.
maprodo is like maprod, but doesn't collect or return anything. It's the Cartesian product analog of mapdo. * eval.c (collect_nothing, maprodo): New static functions. (eval_init): Register maprodo intrinsic. * txr.1: Documented.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.128
1 files changed, 21 insertions, 7 deletions
diff --git a/txr.1 b/txr.1
index 64d5a691..5a5c0017 100644
--- a/txr.1
+++ b/txr.1
@@ -32131,25 +32131,28 @@ and so doesn't return.
-> (2 4)
.brev
-.coNP Functions @ maprod and @ maprend
+.coNP Functions @, maprod @ maprend and @ maprodo
.synb
.mets (maprod < function << iterable *)
.mets (maprend < function << iterable *)
+.mets (maprodo < function << iterable *)
.syne
.desc
The
-.code maprod
-and
+.codn maprod ,
.code maprend
+and
+.code maprodo
functions resemble
-.code mapcar
+.codn mapcar ,
+.code mappend
and
-.codn mappend ,
+.codn mapdo ,
respectively. When given no
.meta iterable
arguments or exactly one
.meta iterable
-argument, they behave exactly like those two functions.
+argument, they behave exactly like those three functions.
When two or more
.meta iterable
@@ -32157,7 +32160,9 @@ arguments are present,
.code maprod
differs from
.code mapcar
-in the following way. Whereas
+in the following way, as do the remaining functions
+from their aforementioned counterparts.
+Whereas
.code mapcar
iterates over the
.meta iterable
@@ -32216,6 +32221,15 @@ and the final result is converted to the same kind of sequence as the leftmost
.meta iterable
if possible.
+The
+.code maprodo
+function, like
+.codn mapdo ,
+ignores the result of
+.meta function
+and returns
+.codn nil .
+
The combination iteration gives priority to the rightmost
.metn iterable ,
which means that the rightmost element of each generated tuple varies