[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Blown Away Slot Initform



Does anybody know if slot initforms can be altered within the class definition 
by side effect, i.e. destructively altering an instance of the class.  Does 
Steel describe this behavior (I cannot find the reference).

As an example, the following code returns => TED

(progn 
  (defclass person () ((x :initform '(1 2 3))))
  (setf x (make-instance 'person))
  (setf (car (slot-value x 'x)) 'ted)
  (setf y (make-instance 'person))
  (car (slot-value y 'x)))

Is this a bug in MCL or is this the expected behavior (inquiring minds want to 
know).

Thanks in advance.