From: Bruno H. <br...@cl...> - 2004-03-24 21:50:12
|
Sam wrote: > any access to an object means an update. ANSI CL says that the update-instance-for-redefined-class invocation can be delayed until any slot is accessed. I.e. (CLASS-OF x), (TYPE-OF x) and - in the simple cases - (PRIN1-TO-STRING x) won't cause the instance to be updated. Why should these operations update the instance when they don't need to? Btw, do you know anything about what is expected to happen when the redefined class is not finalized? Like this: (defclass foo () ((a :initarg :a))) (setq i (make-instance 'foo :a 3)) (sys::%record-ref i 1) ; that's the class-id (defclass foo (undef) ((a :initarg :a))) (slot-value i 'a) (slot-value i 'a) (sys::%record-ref i 1) ; that's the class-id The current clisp behaviour is that the first (slot-value i 'a) gives an error but the second one returns the old value without error - which (taking into account the bug mentioned earlier) means that the instance has not been updated! Ouch. Bruno |