summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-10-16 06:46:19 -0700
committerKaz Kylheku <kaz@kylheku.com>2019-10-16 06:46:19 -0700
commitafbca6b306ddd07e84c44f4d47bd04ddd3cada86 (patch)
tree59f7253c56746b4c5bbec6f8124dc0e3616efee3 /txr.1
parent337ffc1e586d48b5fe6a334a6fd61587961fe261 (diff)
downloadtxr-afbca6b306ddd07e84c44f4d47bd04ddd3cada86.tar.gz
txr-afbca6b306ddd07e84c44f4d47bd04ddd3cada86.tar.bz2
txr-afbca6b306ddd07e84c44f4d47bd04ddd3cada86.zip
tree: node set functions and syntactic places.
* lisplib.c (defset_set_entries): Autoload entries for left, right and key. * share/txr/stdlib/defset.tl (left, right, key): New simple-form defsets. * tree.c (set_left, set_right, set_key): New functions. (tree_init): Register intrinsics set-left, set-right and set-key. * tree.h (set_left, set_right, set_key): Declared. * txr.1: key, left and right classified as accessors. Documented set-key, set-left and set-right.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.162
1 files changed, 61 insertions, 1 deletions
diff --git a/txr.1 b/txr.1
index 5bc31393..7f718700 100644
--- a/txr.1
+++ b/txr.1
@@ -12804,6 +12804,9 @@ defined by \*(TX programs.
.mets (sock-peer << socket )
.mets (carray-sub < carray >> [ from <> [ to ]])
.mets (sub-buf < buf >> [ from <> [ to ]])
+.mets (left << node )
+.mets (right << node )
+.mets (key << node )
.onom
.NP* Built-In Place-Mutating Operators
@@ -45215,11 +45218,15 @@ if
is a tree node. Otherwise, it returns
.codn nil .
-.coNP Functions @, key @ left and @ right
+.coNP Accessors @, key @ left and @ right
.synb
.mets (key << node )
.mets (left << node )
.mets (right << node )
+.mets (set (car << object ) << new-value )
+.mets (set (key << node ) << new-key )
+.mets (set (left << node ) << new-left )
+.mets (set (right << node ) << new-right )
.syne
.desc
The
@@ -45232,6 +45239,59 @@ functions retrieve the corresponding fields of the
object, which must be of type
.codn tnode .
+Forms based on the
+.codn key ,
+.code left
+and
+.code right
+symbol are defined as syntactic places.
+Assigning a value
+.code v
+to
+.code "(key n)"
+using the
+.code set
+operator, as in
+.codn "(set (key n) v)" ,
+is equivalent to
+.code "(set-key n v)"
+except that the value of the expression is
+.code v
+rather than
+.codn n .
+Similar statements hold true for
+.code left
+and
+.code right
+in relation to
+.code set-left
+and
+.codn set-right .
+
+.coNP Functions @, set-key @ set-left and @ set-right
+.synb
+.mets (set-key < node << new-key )
+.mets (set-left < node << new-left )
+.mets (set-right < node << new-right )
+.syne
+.desc
+The
+.codn set-key ,
+.code set-left
+and
+.code set-right
+functions replace the corresponding fields of
+.meta node
+with new values.
+
+The
+.meta node
+argument must be of type
+.codn tnode .
+
+These functions all return
+.metn node .
+
.coNP Function @ copy-tnode
.synb
.mets (copy-tnode << node )