[Openmcl-devel] Re: "leaking" call-method

Marco Baringer mb at bese.it
Sat Jun 4 02:48:07 PDT 2005


"Marco Baringer" <mb at bese.it> writes:

> here's my current attempt:
>
> --------------------------------
> (in-package :common-lisp-user)
>
> (define-method-combination test-combination ()
>   ((after (:after))
>    (primary () :required t))
>   `(let ((*after* ,(when after
>                      `(lambda ()
>                         (call-method ,(first after))))))
>      (declare (special *after*))
>      (call-method ,(first primary))))
>
> (defgeneric foo (a)
>   (:method-combination test-combination)
>   (:method (a)
>     (declare (special *after*))
>     *after*)
>   (:method :after (a)
>     'after))
>
> (funcall (foo 4))
> --------------------------------

after looking into this a bit more it would appear that the lambda
returned by foo's primary method is not "well formed" (the environment
of the closure is a #<bogus object> pointing to a cons cell containing
the numbers we get an error about when calling the closure).

looking through method-combination.lisp make we think that by putting
call-method into a lambda i'm losing some dynamic state which is setup
by the normal method-combination machinery, colud this be the case?
any ideas how to work around this?

-- 
-Marco
Ring the bells that still can ring.
Forget the perfect offering.
There is a crack in everything.
That's how the light gets in.
	-Leonard Cohen




More information about the Openmcl-devel mailing list