summaryrefslogtreecommitdiffstats
path: root/stdlib/doc-syms.tl
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-01-12 07:04:03 -0800
committerKaz Kylheku <kaz@kylheku.com>2022-01-12 07:04:03 -0800
commita4fe85e6df2e308241984294a3d35353d7cc083a (patch)
tree51550488a40d121c489021aca4aad7fecaecf71c /stdlib/doc-syms.tl
parent2e0f7c370fa5012cb54328eb0e73412cb3c59351 (diff)
downloadtxr-a4fe85e6df2e308241984294a3d35353d7cc083a.tar.gz
txr-a4fe85e6df2e308241984294a3d35353d7cc083a.tar.bz2
txr-a4fe85e6df2e308241984294a3d35353d7cc083a.zip
New macros: each-true, some-true, each-false, some-false.
* lisplib.c (arith_each_set_entries): Trigger autoload on new symbols. * stdilb/arith-each.tl (sys:arith-each): Generalize macro to handle short-circuiting logical operations. The op-iv parameter, which is a cons, is spread into two op and iv parameter. One new argument appears, short-circ. This specifies a code for short-circuiting behavior: t means iteration continues while the result is true; nil means it continues while it is nil, and + means iteration continues while the accumulator is nonzero. A new convention is in effect: the operator has to be specified as a list in order to request accumulating behavior, e.g (+) or (*). Otherwise the operator specifies a predicate that is applied to the forms, without taking into account the prior value. (sum-each, sum-each*, mul-each, mul-each*): Spread the op-iv arguments. Wrap the op argument in a list to request accumulation. In the case of mul-each and mul-each*, specify + for the short-circ argument, which means that iteration stops when the accumulator becomes zerop. sum-each and sum-each* specify : for the short-circ argument which is unrecognized, and so ther is no short-circuiting behavior. (each-true, some-true, each-false, some-false): New macros. * tests/016/arith.tl: New tests. * txr.1: Documented new macros and added note about possible short-circuiting in mul-each and mul-each*. * stdlib/doc-syms.tl: Updated.
Diffstat (limited to 'stdlib/doc-syms.tl')
-rw-r--r--stdlib/doc-syms.tl4
1 files changed, 4 insertions, 0 deletions
diff --git a/stdlib/doc-syms.tl b/stdlib/doc-syms.tl
index fff64b8a..1148e256 100644
--- a/stdlib/doc-syms.tl
+++ b/stdlib/doc-syms.tl
@@ -536,10 +536,12 @@
("eacces" "N-036B1BDB")
("each" "N-0105F01D")
("each*" "N-0105F01D")
+ ("each-false" "N-016BDF48")
("each-match" "N-01CB9595")
("each-match-product" "N-01CB9595")
("each-prod" "N-02CA3C70")
("each-prod*" "N-02660E4F")
+ ("each-true" "N-016BDF48")
("eaddrinuse" "N-036B1BDB")
("eaddrnotavail" "N-036B1BDB")
("eafnosupport" "N-036B1BDB")
@@ -1821,6 +1823,8 @@
("socklen-t" "N-01153D9E")
("sol-socket" "N-031C01CB")
("some" "D-0040")
+ ("some-false" "N-016BDF48")
+ ("some-true" "N-016BDF48")
("sort" "N-01FE5176")
("sort-group" "N-01E65DDC")
("source-loc" "N-0370CD69")