This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: Trouble understanding define (!)
[OK, here's my punishment for posting hard words on the list: I now
seem to fill the list with my own misconceptions. :( ]
Michael Livshin <mlivshin@bigfoot.com> writes:
> do extentions propagate back? i.e.
>
> -----------------------------------------------------------------
> ; module A
> (define-module (A))
>
> (export grumble mumble)
>
> (define-method grumble ((a <A>))
> 'grumble)
>
> (define (mumble thing)
> (grumble thing))
>
> -----------------------------------------------------------------
> ; module B
> (define-module (B) :use-module (A))
>
> (define-class <B> ...)
>
> (define-method grumble ((b <B>))
> 'return-of-the-grumble)
>
> (define grumble-result (mumble (make <B>)))
> -----------------------------------------------------------------
>
> grumble-result should be 'return-of-the-grumble, but from the above
> paragraph it seems that it will be 'grumble. what did I miss?
I didn't read your code carefully enough in my previous reply.
Extensions *don't* propagate back with my suggested change. The call
to mumble will result in A:grumble reporting "no applicable method".
The question now is if this is what we want.
Part of the answer is: certainly *not* in the case of the MOP.
Further thinking required...