summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-08-02 20:06:18 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-08-02 20:06:18 -0700
commit1d9f2661a2f151b9b264dd696821730e2e6e3e46 (patch)
tree817c4551efabd00747ce7195e8e54d9399699473 /txr.1
parentb267c86f0bb146ff0919aa7d7cf83e7d8e5e916c (diff)
downloadtxr-1d9f2661a2f151b9b264dd696821730e2e6e3e46.tar.gz
txr-1d9f2661a2f151b9b264dd696821730e2e6e3e46.tar.bz2
txr-1d9f2661a2f151b9b264dd696821730e2e6e3e46.zip
Bi-directional string tree match for non-vars.
There is an inconsistency in @(bind) in that given @(bind x y) where x is a variable, both directions are tried for a string tree match. x could be tree of strings and y a string atom, or vice versa. But if x is just an atom, or a Lisp evaluation, then only one direction is tried. @(bind @(list "a" "b") "a") succeeds, but @(bind "a" @(list "a" "b")) fails. * match.c (dest_bind): Test both directions in the scalar and Lisp evaluated cases of the left hand side. Subject to compatibility, just in case. * txr.1: Compat note added.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.128
1 files changed, 28 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index 22e24752..8d88ff38 100644
--- a/txr.1
+++ b/txr.1
@@ -60685,6 +60685,34 @@ of these version values, the described behaviors are provided if
is given an argument which is equal or lower. For instance
.code "-C 103"
selects the behaviors described below for version 105, but not those for 102.
+.IP 183
+A value of 183 or lower restores an inconsistent behavior in the
+.code "@(bind)"
+directive and other places in the \*(TX pattern language where binding
+takes place. Prior to version 184, a string tree match was only tried in
+both directions when the left hand side of a binding (the "pattern") was a
+variable. For non-variable pattern terms, such as Lisp expressions or atoms,
+the string tree match was tried in one direction only: a string tree arising
+out of the pattern could match a string atom value on the right side.
+A string tree is a nested list structure whose leaves are strings: a list
+of strings, a list of lists of strings, and so on, in any mixture.
+Concretely, before \*(TX 184,
+.cblk
+@(bind "a" ("a" "b" "c"))
+.cble
+didn't match, but
+.cblk
+@(bind ("a" "b" "c") "a")
+.cble
+did. However, if the variable
+.code a
+contained
+.strn a
+then
+.cblk
+@(bind a ("a" "b" "c"))
+.cble
+did match: an inconsistency.
.IP 177
A value of 177 or lower causes the emulation of a bug which was present in the
.code rng