[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: <procedure> and <generic> base class?
From: |
Neil Jerram |
Subject: |
Re: <procedure> and <generic> base class? |
Date: |
Fri, 18 Aug 2006 14:52:29 +0100 |
User-agent: |
Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux) |
"Marco Maggi" <address@hidden> writes:
> Ciao,
>
> when I define a generic function that accepts a procedure
> or generic function as parameter I have to define two
> identical functions:
>
> (define-method (map (p <procedure>) ...
> (define-method (map (p <generic>) ...
>
> is there a base class for <procedure> and <generic>?
Here's how you can find out:
address@hidden:~$ guile -q
guile> (use-modules (oop goops))
guile> (apropos "class-preced")
(oop goops): class-precedence-list #<primitive-procedure
class-precedence-list>
guile> (class-precedence-list <procedure>)
(#<<procedure-class> <procedure> 4031bce0> #<<class> <applicable> 4031d4c0>
#<<class> <top> 4031ff40>)
guile> (class-precedence-list <generic>)
(#<<entity-class> <generic> 4031d1c0> #<<entity-class> <entity> 4031d3e0>
#<<class> <object> 4031fe80> #<<class> <applicable> 4031d4c0> #<<class> <top>
4031ff40>)
guile>
So yes, it seems there is a common base class, <applicable>.
Regards,
Neil