- as (kind value type) = slot-entry collect
- (ecase kind
- ((nil)
- (unless before-method-p
- `(setf (clos-slots-ref .slots. ,i) +slot-unbound+)))
- ((param var)
- `(setf (clos-slots-ref .slots. ,i)
- (with-type-checked (,type ,safe-p)
- ,value)))
- (initfn
- `(setf (clos-slots-ref .slots. ,i)
- (with-type-checked (,type ,safe-p)
- (funcall ,value))))
- (initform/initfn
- (if before-method-p
- `(when (eq (clos-slots-ref .slots. ,i)
- +slot-unbound+)
- (setf (clos-slots-ref .slots. ,i)
- (with-type-checked (,type ,safe-p)
- (funcall ,value))))
- `(setf (clos-slots-ref .slots. ,i)
- (with-type-checked (,type ,safe-p)
- (funcall ,value)))))
- (initform
- (if before-method-p
- `(when (eq (clos-slots-ref .slots. ,i)
- +slot-unbound+)
- (setf (clos-slots-ref .slots. ,i)
- (with-type-checked (,type ,safe-p)
- ',(constant-form-value value))))
- `(setf (clos-slots-ref .slots. ,i)
- (with-type-checked (,type ,safe-p)
- ',(constant-form-value value)))))
- (constant
- `(setf (clos-slots-ref .slots. ,i)
- (with-type-checked (,type ,safe-p)
- ',(constant-form-value value))))))))
+ as (kind value type slotd) = slot-entry
+ collect
+ (flet ((setf-form (value-form)
+ (if (member slotd setf-svuc-slots :test #'eq)
+ `(setf (slot-value-using-class
+ ,class .instance. ,slotd)
+ ,value-form)
+ `(setf (clos-slots-ref .slots. ,i)
+ (with-type-checked (,type ,safe-p)
+ ,value-form))))
+ (not-boundp-form ()
+ (if (member slotd sbuc-slots :test #'eq)
+ `(slot-boundp-using-class
+ ,class .instance. ,slotd)
+ `(eq (clos-slots-ref .slots. ,i)
+ +slot-unbound+))))
+ (ecase kind
+ ((nil)
+ (unless before-method-p
+ `(setf (clos-slots-ref .slots. ,i)
+ +slot-unbound+)))
+ ((param var)
+ (setf-form value))
+ (initfn
+ (setf-form `(funcall ,value)))
+ (initform/initfn
+ (if before-method-p
+ `(when ,(not-boundp-form)
+ ,(setf-form `(funcall ,value)))
+ (setf-form `(funcall ,value))))
+ (initform
+ (if before-method-p
+ `(when ,(not-boundp-form)
+ ,(setf-form `',(constant-form-value value)))
+ (setf-form `',(constant-form-value value))))
+ (constant
+ (setf-form `',(constant-form-value value))))))))