diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-10-06 21:32:34 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-10-06 21:32:34 -0700 |
commit | 8720843f7a55991fb52ca1de7be2dab341ae7517 (patch) | |
tree | 66020514008dcfbcd328a02913a3a34edbed00c9 /txr.1 | |
parent | 8beabcd33ac984ee454f0871ffd45b940e279732 (diff) | |
download | txr-8720843f7a55991fb52ca1de7be2dab341ae7517.tar.gz txr-8720843f7a55991fb52ca1de7be2dab341ae7517.tar.bz2 txr-8720843f7a55991fb52ca1de7be2dab341ae7517.zip |
New function: reset-struct.
* struct.c (reset_struct): New function.
(struct_init): Register reset_struct intrinsic.
* struct.h (reset_struct): Declared.
* txr.1: documented reset-struct.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 33 |
1 files changed, 33 insertions, 0 deletions
@@ -18745,6 +18745,39 @@ if omitted. Note that finalizers are not executed prior to replacing the slot values. +.coNP Function @ reset-struct +.synb +.mets (reset-struct << struct-obj ) +.syne +.desc +The +.code reset-struct +function reinitializes the structure object +.meta struct-obj +as if it were being newly created. +First, all the slots are set to +.code nil +as if by the +.code clear-struct +function. Then the slots are initialized by invoking the +initialization functions, in order of the supertype ancestry, just as would be +done for a new structure object created by +.code make-struct +with an empty +.meta slot-init-plist +and no boa arguments. + +Note that finalizers registered against +.meta struct-obj +are not invoked, and remain registered. +If the structure has state which is cleaned up by +finalizers, it is advisable to invoke them using +.code call-finalizers +prior to using +.codn reset-struct , +or to take other measures to deal with the +situation. + .coNP Function @ replace-struct .synb .mets (replace-struct < target-obj << source-obj ) |