summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2018-01-31 06:10:12 -0800
committerKaz Kylheku <kaz@kylheku.com>2018-01-31 06:10:12 -0800
commit8afd3f7ed5980d5ee04a41601b21f910e3e46bf5 (patch)
tree92db71d7a69fa0178e1a9d2284f013b42143ccdc
parent02432b74c66eedc962ce9cca0490d3d48ae3232d (diff)
downloadtxr-8afd3f7ed5980d5ee04a41601b21f910e3e46bf5.tar.gz
txr-8afd3f7ed5980d5ee04a41601b21f910e3e46bf5.tar.bz2
txr-8afd3f7ed5980d5ee04a41601b21f910e3e46bf5.zip
doc: more detail in ref/refset re: structs.
* txr.1: Describe fallback of ref and refset onto list-like operations if lambda/lambda-set are not supported.
-rw-r--r--txr.137
1 files changed, 32 insertions, 5 deletions
diff --git a/txr.1 b/txr.1
index 71c96fbc..aeeee908 100644
--- a/txr.1
+++ b/txr.1
@@ -26727,19 +26727,46 @@ If
.meta seq
is a structure, it supports
.code ref
-if it has a
+directly if it has a
.code lambda
method. The
.meta index
argument is passed to that method, and the resulting value is
-returned. Similarly, a structure supports
+returned.
+If a structure lacks a
+.code lambda
+method, but has a
+.code car
+method, then
+.code ref
+treats it as a list, traversing the structure using
+.cod3 car / cdr
+operations. In the absence of support for these operations,
+the function fails with an error exception.
+
+Similarly, a structure supports
.code refset
-if it has a
+directly if it has a
.code lambda-set
-method, which is called with
+method. This gets called with
.meta index
and
-.metn new-value .
+.meta new-value
+as arguments. Then
+.meta new-value
+is returned.
+If a structure lacks a
+.code lambda-set
+method, then
+.code refset
+treats it as a list, traversing the structure using
+.cod3 car / cdr
+operations, and storing
+.meta new-value
+using
+.codn rplaca .
+In the absence of support for these operations,
+the function fails with an error exception.
The
.code ref