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

around method for make-instance

Is there something special about putting methods
around the make-instance primary method?

For example, if I define:

    (defclass foo () ())

    (defmethod hello ((x foo))

    (defmethod hello :around ((x foo))
      (let ((instance (call-next-method)))
          (list instance)))

This around method works fine.  I get:

? (hello (make-instance 'foo))
   => (HI)

But when I define:

    (defmethod make-instance :around 
               ((x foo) &rest initargs)
      (let ((instance (call-next-method)))
          (list instance)))

then I get:

? (make-instance 'foo)
   => #<FOO #x17E44F1>

Shouldn't I have gotten:
     (#<FOO #x17E44F1>)

In other words, why didn't the around method
for make-instance cause the instance to be put
in a list?  Thanks for any help.