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

Re: MAKE-METHOD arguments discussion



    Date: 5 Jan 87 13:06 PST
    From: Gregor Kiczales <Gregor.pa@Xerox.COM>

	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))

Oh, gross!  What is the reason for wanting this?

    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

Sure, but doesn't using method-lambda constitute blessing the function?