This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Trouble understanding define (!)


Neil Jerram <neil@ossau.uklinux.net> writes:

> I think that <extended-generic> is on the right track.

I seem to be on the wrong one, then ;)

>   - define-generic NAME
>     Makes NAME a <generic> with no methods.  Loses any existing value
>     for NAME.
> 
>   - define-generic NAME #:importing GF
>     Makes NAME an <extended-generic> that uses the existing GF.  Loses
>     any existing value for NAME.
> 
>   - define-extended-generic NAME
>     -> define-generic NAME #:importing NAME

hmmm...

why would you ever want to block your methods from extending an
imported generic?  so you can have something like CL's `with-methods'
in a module scope?  while this does seem possible, it hardly seems
useful.

>   - define-method GF SPEC BODY
>     Raise error if (not (is-a? GF <generic>)).  (GF arg having been
>     evaluated.)  Otherwise create specified method and use add-method!
>     to add it to GF.

one addition: defining a class slot with an
(#:accessor/#:setter/#:getter NAME) argument raises error if
(not (is-a? GF NAME)).

>         Neil

--mike, beating a vague outline of a dead horse.

-- 
If all the economists in the world were laid end to end, it would probably
be a good thing.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]