summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-09-10 07:56:15 -0700
committerKaz Kylheku <kaz@kylheku.com>2022-09-10 07:56:15 -0700
commitb2e6fda0c5ab7d0419814007530e5f655c93ea1a (patch)
tree352d8f2f010c1c94eb66c66b3afa0c132528971f
parent6fb34ff4e32cab93f437ed6c3d93042b87024437 (diff)
downloadtxr-b2e6fda0c5ab7d0419814007530e5f655c93ea1a.tar.gz
txr-b2e6fda0c5ab7d0419814007530e5f655c93ea1a.tar.bz2
txr-b2e6fda0c5ab7d0419814007530e5f655c93ea1a.zip
doc: document [. expr] support.
* txr.1: Document and advise users that it doesn't work in 281 or older versions.
-rw-r--r--txr.128
1 files changed, 28 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index 1037fbc9..0f9ec8c6 100644
--- a/txr.1
+++ b/txr.1
@@ -12018,6 +12018,34 @@ or an atom
as
.codn "(. sym)" .
+This notation is implemented for the square brackets, according to this
+transformation:
+
+.verb
+ [. expr] -> (dwim . expr)
+.brev
+
+This is useful in Structural Pattern Matching, allowing a pattern like
+
+.verb
+ [. @args]
+.brev
+
+to match a
+.code dwim
+expression and capture all of its arguments in a variable, without having
+to resort to the internal notation:
+
+Compatibility Note: support for
+.code "[. expr]"
+was introduced in \*(TX 282. Older versions do not read the syntax,
+but do print
+.code "(dwim . @var)"
+as
+.code "[. @var]"
+which is then unreadable in those versions, breaking read-print
+consistency.
+
.NP* Referencing Dot
A dot token which is flanked by expressions on both sides, without any