- (if (slot-readable-p slotd)
- (let* ((type (slot-definition-type slotd))
- (pname (slot-definition-pname slotd))
- (reader (reader-function type :ref :get)))
- #'(lambda (object)
- (with-memory (gvalue +gvalue-size+)
- (%gvalue-init gvalue (find-type-number type))
- (%object-get-property object pname gvalue)
- (funcall reader gvalue +gvalue-value-offset+))))
+ (let* ((type (slot-definition-type slotd))
+ (pname (slot-definition-pname slotd))
+ (reader (reader-function type :ref :get)))
+ #'(lambda (object)
+ (with-memory (gvalue +gvalue-size+)
+ (%gvalue-init gvalue (find-type-number type))
+ (%object-get-property object pname gvalue)
+ (funcall reader gvalue +gvalue-value-offset+)))))
+
+(defmethod compute-slot-writer-function :around ((slotd effective-property-slot-definition))
+ (if (construct-only-property-p slotd)
+ #'(lambda (value object)
+ (declare (ignore value object))
+ (unless *ignore-setting-construct-only-property*
+ (error 'unwritable-slot :name (slot-definition-name slotd) :instance object)))