summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2012-01-25 23:40:40 -0800
committerKaz Kylheku <kaz@kylheku.com>2012-01-25 23:40:40 -0800
commitb7aae46f879bfc8a43781a08aaef9f506f7211bf (patch)
tree4c7aab92f25bb4fcbbe2ec486f9579f20438b387 /txr.1
parentff58e8a616d7d9b9d57fa26cec86778b3e30c2d9 (diff)
downloadtxr-b7aae46f879bfc8a43781a08aaef9f506f7211bf.tar.gz
txr-b7aae46f879bfc8a43781a08aaef9f506f7211bf.tar.bz2
txr-b7aae46f879bfc8a43781a08aaef9f506f7211bf.zip
* eval.c (dwim_loc): Handles full responsibility for assigning
to list and array ranges. (op_modplace): Pass extra arguments to dwim_loc so it can do the job for ranges. If dwim_loc returns 0, it means that it did everything. (op_dwim): Support list and array ranges. * txr.1: Documented.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.124
1 files changed, 22 insertions, 2 deletions
diff --git a/txr.1 b/txr.1
index dc6625e5..3853fe7f 100644
--- a/txr.1
+++ b/txr.1
@@ -4372,8 +4372,10 @@ shorthand for cons.
That is to say, A .. B translates to (cons A B), and so for instance
(a b .. (c d) e .. f . g) means (a (cons b (c d)) (cons e f) . g).
-This is a syntactic sugar in certain situations in which a cons
-is used to represent a pair of numbers or other objects.
+This is a syntactic sugar useful in certain situations in which a cons is used
+to represent a pair of numbers or other objects. For instance, if L
+is a list, then [L 1 .. 3] computes a sublist of L consisting of
+elements 1 through 2 (counting from zero).
.SS The DWIM Brackets
@@ -4843,10 +4845,22 @@ refers to the first element. Indexed list access does not throw exceptions.
Negative indices yield nil, and indices beyond the end of a list
yield nil. (However assignment to a nonexistent list element throws.)
+.IP [<list> <from-index>..<to-below-index>]
+Retrieve the specified range of elements, exactly as if
+using (sub-list <list> <from-index> <to-below-index>).
+The range of elements is specified in the car and cdr fields of a cons cell,
+for which the .. (dotdot) syntactic sugar is useful.
+
.IP [<vector> <index>]
Retrieve the specified element of a vector. This is equivalent to
(vecref <vector> <index>).
+.IP [<vector> <from-index>..<to-below-index>]
+Retrieve the specified range of elements, exactly as if
+using (sub-vec <list> <from-index> <to-below-index>).
+The range of elements is specified in the car and cdr fields of a cons cell,
+for which the .. (dotdot) syntactic sugar is useful.
+
.IP [<string> <index>]
Retrieve the specified element of a string. This is equivalent to
(chr-str <string> <index>).
@@ -4858,6 +4872,12 @@ or <default-value> if there is no such entry.
The list, vector and hash table forms of dwim denote places
that can be assigned.
+The list and vector range forms can be assigned only using the set operator,
+not using the others like push and inc. Assigning to a vector range modifies
+the vector object; it is implemented using replace-vec. Assigning to a list
+range updates the form which contains the list, so the expression denoting the
+list must be an assignable place.
+
.TP
Notes: