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

Re: MAKE-METHOD arguments discussion



    Moon says:

    I forgot to mention that I don't see how the capability of
    WITH-SLOTS to determine the class of an instance-form by looking at
    the defmethod lambda-list can be implemented without blessing the
    function.  Or is that a feature that only works inside defmethod
    and isn't available to users making their own methods at the
    make-method level?

The reason I don't want the function to be blessed is that given this
situation:

(defclass foo () (x))
(defmethod foo ((f foo)) (slot-value f 'x))

I want it to be legal to say one of:

(funcall (get-method (symbol-function 'foo) () (list (class-named
'foo)))
         (make-instance 'foo))

or:

(funcall (method-function
            (get-method (symbol-function 'foo) () (list (class-named
'foo))))
         (make-instance 'foo))


I want it to have the same effect as saying:

(foo (make-instance 'foo))



Danny's idea for communicating class informat to with-slots, (including
information which would allow optimizations), was to have method-lambda,
so:

(funcall #'(method-lambda ((f foo)) (with (f) x))
         (make-instance 'foo 'x 1))

would return 1, but

(funcall #'(method-lambda ((f foo)) (with (f) x))
         nil)

is an error