summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2018-01-25 15:28:34 -0800
committerKaz Kylheku <kaz@kylheku.com>2018-01-25 15:28:34 -0800
commit54e007f7e7f71bf93d9744c2c668c61a68b54d46 (patch)
treecdc26be7dd5346bcc9a441fb6a93c3abca896ac7 /txr.1
parenta2a18e6a99ddb3770cd0ca7f6afc944cae247565 (diff)
downloadtxr-54e007f7e7f71bf93d9744c2c668c61a68b54d46.tar.gz
txr-54e007f7e7f71bf93d9744c2c668c61a68b54d46.tar.bz2
txr-54e007f7e7f71bf93d9744c2c668c61a68b54d46.zip
doc: some clarifications about dwim brackets.
txr.1: The equivalences between [x i] and some functions like ref are dynamic; they depend not only on the type ofx, but also whether i is a range or integer.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.119
1 files changed, 13 insertions, 6 deletions
diff --git a/txr.1 b/txr.1
index a53fac35..1ba40a4d 100644
--- a/txr.1
+++ b/txr.1
@@ -22176,17 +22176,20 @@ argument must be a modifiable string.
Direct use of
.code chr-str
-is equivalent to the DWIM bracket notation except
-that
+is equivalent to the DWIM bracket notation provided that
.meta str
-must be a string. The following relation holds:
+is a string and
+.meta idx
+an integer. The following relation holds:
.cblk
(chr-str-set s i c) --> (set [s i] c)
.cble
-since
-.codn "(set [s i] c) <--> (refset s i c)" ,
+Since
+.code "(set [s i] c) <--> (refset s i c)"
+for an integer index
+.codn i ,
this also holds:
.cblk
@@ -26786,7 +26789,11 @@ The following equivalences hold between
.code ref
and
.codn refset ,
-and the DWIM bracket syntax:
+and the DWIM bracket syntax, provided that
+.meta idx
+is a scalar index and
+.meta seq
+is a sequence object, rather than a hash.
.cblk
(ref seq idx) <--> [seq idx]