diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-03-12 12:27:57 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-03-12 12:27:57 -0700 |
commit | 6b7c80ff724f4f8baec2fc0984c6178f75fd9bcd (patch) | |
tree | 7d27494d2058e68d5a727387e810fbdd78a9237d /txr.1 | |
parent | 7809492815eb35df33e52aae72e03ce10349def5 (diff) | |
download | txr-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.1 | 45 |
1 files changed, 45 insertions, 0 deletions
@@ -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 ) |