summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-01-17 17:12:59 -0800
committerKaz Kylheku <kaz@kylheku.com>2021-01-17 17:12:59 -0800
commit5378d3237ba7f9ba91d011536df3731d69516a5b (patch)
treea2fa7e7aa27dcc1f6a8f0f56cc6c0f0c8b15e3df
parent5d707f9c2b9428ed2b2288912d3f448724c93952 (diff)
downloadtxr-5378d3237ba7f9ba91d011536df3731d69516a5b.tar.gz
txr-5378d3237ba7f9ba91d011536df3731d69516a5b.tar.bz2
txr-5378d3237ba7f9ba91d011536df3731d69516a5b.zip
doc: document @(some) pattern operator.
-rw-r--r--txr.128
1 files changed, 28 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index 85b8911d..95d47627 100644
--- a/txr.1
+++ b/txr.1
@@ -40012,6 +40012,34 @@ operator behaves like a failed match when the list is empty.
--> ((1 2 3) (a b c))
.brev
+.coNP Pattern operator @ some
+.synb
+.mets @(some << pattern )
+.syne
+.desc
+The
+.code some
+pattern operator requires the corresponding object to be a list.
+The specified
+.meta pattern
+is applied against every element of the list. The match is successful if
+.meta pattern
+finds a matching element.
+
+Variables are extracted from the first matching which is found.
+
+.TP* Example:
+
+.verb
+ ;; the second (x 2 b) element is the leftmost one
+ ;; which matches the (x @a @b) pattern
+
+ (when-match @(some (x @a @b))
+ '((y 1 a) (x 2 b) (z 3 c))
+ (list a b))
+ -> (2 b)
+.brev
+
.SS* Quasiquote Operator Syntax
.coNP Macro @ qquote
.synb