diff options
-rw-r--r-- | share/txr/stdlib/struct.tl | 26 | ||||
-rw-r--r-- | txr.1 | 4 |
2 files changed, 15 insertions, 15 deletions
diff --git a/share/txr/stdlib/struct.tl b/share/txr/stdlib/struct.tl index dcfcc864..7213d9eb 100644 --- a/share/txr/stdlib/struct.tl +++ b/share/txr/stdlib/struct.tl @@ -121,19 +121,19 @@ (static-slot-set ,arg-sym ',@2 ,@3))) stat-si-forms))) ,(if (or inst-si-forms instance-init-form instance-fini-form) - ^(lambda (,arg-sym) - ,*(if inst-si-forms - ^((let ((,type-sym (struct-type ,arg-sym))) - ,*(mapcar (aret ^(unless (static-slot-p ,type-sym ',@2) - (slotset ,arg-sym ',@2 ,@3))) - inst-si-forms)))) - ,*(if (cdr instance-init-form) - ^((let ((,(car instance-init-form) ,arg-sym)) - ,*(cdr instance-init-form)))) - ,*(if (cdr instance-fini-form) - ^((finalize ,arg-sym (lambda (,(car instance-fini-form)) - ,*(cdr instance-fini-form)) - t))))) + ^(lambda (,arg-sym) + ,*(if (cdr instance-fini-form) + ^((finalize ,arg-sym (lambda (,(car instance-fini-form)) + ,*(cdr instance-fini-form)) + t))) + ,*(if inst-si-forms + ^((let ((,type-sym (struct-type ,arg-sym))) + ,*(mapcar (aret ^(unless (static-slot-p ,type-sym ',@2) + (slotset ,arg-sym ',@2 ,@3))) + inst-si-forms)))) + ,*(if (cdr instance-init-form) + ^((let ((,(car instance-init-form) ,arg-sym)) + ,*(cdr instance-init-form)))))) ,(when args (when (> (countql : args) 1) (throwf 'eval-error "~s: multiple colons in boa syntax" @@ -18025,8 +18025,8 @@ a finalization function which is associated with the structure instance, as if by use of the .code finalize function. This finalization registration takes place -as the last step when an instance of the structure -is created, after the slots are initialized and +as the first step when an instance of the structure +is created, before the slots are initialized and the .code :init code, if any, has been executed. The registration |