summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-03-12 12:27:57 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-03-12 12:27:57 -0700
commit6b7c80ff724f4f8baec2fc0984c6178f75fd9bcd (patch)
tree7d27494d2058e68d5a727387e810fbdd78a9237d /txr.1
parent7809492815eb35df33e52aae72e03ce10349def5 (diff)
downloadtxr-6b7c80ff724f4f8baec2fc0984c6178f75fd9bcd.tar.gz
txr-6b7c80ff724f4f8baec2fc0984c6178f75fd9bcd.tar.bz2
txr-6b7c80ff724f4f8baec2fc0984c6178f75fd9bcd.zip
New: struct-from-plist and struct-from-args.
* struct.c (struct_init): Register new functions. (struct_from_plist, struct_from_args): New functions. * struct.h (struct_from_plist, struct_from_args): Declared. * txr.1: Documented.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.145
1 files changed, 45 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index d22c16ba..c6915a8f 100644
--- a/txr.1
+++ b/txr.1
@@ -23214,6 +23214,51 @@ invocation. Initialization of the structure proceeds as described
in the description of
.codn make-struct .
+.coNP Functions @ struct-from-plist and @ struct-from-args
+.synb
+.mets (struct-from-plist < type >> { slot << value }*)
+.mets (struct-from-arg < type << arg *)
+.syne
+.desc
+The
+.code struct-from-plist
+and
+.code struct-from-arg
+are interfaces to the
+.code make-struct
+function.
+
+The
+.code struct-from-plist
+function passes its
+.meta slot
+and
+.meta value
+arguments as the
+.meta slot-init-plist
+argument of
+.codn make-struct .
+It passes no boa constructor arguments.
+
+The
+.code struct-from-plist
+function calls
+.meta make-struct
+with an empty
+.metn slot-init-plist ,
+passing down the list of
+.metn arg -s.
+
+The following equivalences hold:
+
+.cblk
+ (struct-from-plist a s0 v0 s1 v1 ...)
+ <--> (make-struct a (list s0 v0 s1 v1 ...))
+
+ (struct-from-args a v0 v1 v2 ...)
+ <--> (make-struct a nil v0 v1 v2 ...)
+.cble
+
.coNP Function @ copy-struct
.synb
.mets (copy-struct << struct-obj )