diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2018-01-31 06:10:12 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2018-01-31 06:10:12 -0800 |
commit | bfcd3c607951a060791b31d86a21d547c1269e4e (patch) | |
tree | 92db71d7a69fa0178e1a9d2284f013b42143ccdc | |
parent | 23fa9bd8164b1b9e5298e598709b52e2d34b6f56 (diff) | |
download | txr-bfcd3c607951a060791b31d86a21d547c1269e4e.tar.gz txr-bfcd3c607951a060791b31d86a21d547c1269e4e.tar.bz2 txr-bfcd3c607951a060791b31d86a21d547c1269e4e.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.1 | 37 |
1 files changed, 32 insertions, 5 deletions
@@ -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 |