* <procedure> and <generic> base class?
@ 2006-08-18 5:45 Marco Maggi
2006-08-18 13:52 ` Neil Jerram
0 siblings, 1 reply; 3+ messages in thread
From: Marco Maggi @ 2006-08-18 5:45 UTC (permalink / raw)
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>?
--
Marco Maggi
"They say jump!, you say how high?"
Rage Against the Machine - "Bullet in the Head"
_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: <procedure> and <generic> base class?
2006-08-18 5:45 <procedure> and <generic> base class? Marco Maggi
@ 2006-08-18 13:52 ` Neil Jerram
0 siblings, 0 replies; 3+ messages in thread
From: Neil Jerram @ 2006-08-18 13:52 UTC (permalink / raw)
Cc: guile-user
"Marco Maggi" <marco.maggi-ipsu@poste.it> 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:
neil@laruns:~$ 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
_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: <procedure> and <generic> base class?
@ 2006-08-18 19:03 Marco Maggi
0 siblings, 0 replies; 3+ messages in thread
From: Marco Maggi @ 2006-08-18 19:03 UTC (permalink / raw)
Yes! <applicable> works.
--
Marco Maggi
"They say jump!, you say how high?"
Rage Against the Machine - "Bullet in the Head"
_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-08-18 19:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-18 5:45 <procedure> and <generic> base class? Marco Maggi
2006-08-18 13:52 ` Neil Jerram
-- strict thread matches above, loose matches on Subject: below --
2006-08-18 19:03 Marco Maggi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).