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

Re: Some invariants



    Date: 7 Jan 87 17:28 PST
    From: Masinter.pa@Xerox.COM

    That make-instance always creates new structure is a very useful
    property; for example, it means that

    (let ((x (make-instance 'foo)))
       (setf (foo-slot x) 3)
       x)

    has no global side effects.

Not so.  Someone might have done

(defmethod-setf foo-slot :before ((foo foo)) (new-value)
  (push (list foo 'slot new-value) *mumble*))

Accessors are generic, and therefore can do anything.