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

Re: who makes class-prototype



In-reply-to: kanderso@PEBBLES.BBN.COM's message of 16 Aug 88 00:20:12 GMT

In article <7183@srcsip.UUCP> kanderso@PEBBLES.BBN.COM writes:

About a month ago Gregor posted several versions of a message with subject
"Re: method discrimination on persistent objects" that contained the
following: 

    ...
    As soon as the instances are allocated, we have to set their object-id.

    (defmethod allocate-instance ((class db-class))
      (let ((instance (call-next-method)))
	(setf (slot-value instance 'object-id) (allocate-object-id))
	instance))
    ...

The problem is knowing whether 'allocate-object-id' is called when the
class-prototype instace is allocated.  In my application it is imperative
that it not be.  Hence it is necessary that CLOS specifies that
allocate-instance is not called for the class-prototpe, or that there be
some canonical way for an application to determine that the current call is
to make the class-prototype.

The fact that both Gregor and I (independently) decided that the correct
place for the call to allocate-object-id should be on allocate-instance
would tend to indicate that performing this action is within the "style"
presented by the spec.  I realize that assigning object id's could be made
part of the make-instance protocol, but I feel that would leave a hole in
the system because allocate-instance is part of the defined CLOS interface,
and people could justifiably call allocate-instance directly, then there
would exist an object without an id.