• @akkartikOP
    link
    fedilink
    11 year ago

    It works for adding new slots, but won’t update default values after the fact:

    * (defclass point () (x y))
    * (defvar p1 (make-instance 'point))
    * (inspect p1)
    The object is a STANDARD-OBJECT of type POINT.
    0. X: "unbound"
    1. Y: "unbound"
    * (defclass point () (x y (z :initform 4)))
    * (inspect p1)
    The object is a STANDARD-OBJECT of type POINT.
    0. X: "unbound"
    1. Y: "unbound"
    2. Z: 4
    
    * (defclass point () ((x :initform 3) y (z :initform 4)))
    * (inspect p1)
    The object is a STANDARD-OBJECT of type POINT.
    0. X: "unbound"
    1. Y: "unbound"
    2. Z: 4
    

    Even this seems like black magic to me.