Scott wrote:
> I'm looking for any articles that describe how a particular method/
> function is chosen for generics/multi-methods. Googling for words
> like "generic", "method", "signature", and "function" hasn't been as
> rewarding as I would have hoped... I found one article for how the R
> programming language does it, and I've looked at how the python
> multimethod implementation does it, but I would be interested in
> others (TinyCLOS?) too.
>
> Thanks in advance for any replies!
The CLOS / ANSI Common Lisp specification has a pretty detailed
description of method selection and combination. See
http://www.lispworks.com/do***entation/HyperSpec/Body/07_ff.htm
for an
online reference. Since CLOS provides a lot of (extremely useful) bells
and whistles, the essential steps may be a bit blurred, but it's
certainly possible to get through the description.
There are a couple of papers about CLOS listed at
http://www.dreamsongs.com/CLOS.html
- "CLOS in Context: The Shape of the
Design Space" is an especially interesting read, because it provides
background material for some of the design decisions behind CLOS, which
helps a lot to understand them.
"The Art of the Metaobject Protocol" (AMOP) gives an introduction into
metaobject protocols, based on variations of CLOS. It also contains a
specification of the CLOS Metaobject Protocol, which can also be found
online at http://www.lisp.org/mop/
. That book is one of the best books
in computer science I am aware of, it covers some very fundamental and
im****tant programming concepts. It also includes Closette, a subset of
CLOS from which you can derive the essential details of generic function
invocation / method selection and combination.
Tiny CLOS is an even smaller subset, and it should be possible to
understand the approach from just reading its source code. However, AMOP
is quite essential, still.
Dylan is a close cousin of CLOS, closer to Scheme than to Common Lisp at
its core, with a non-Lisp more mainstreamish syntax. The Dylan language
specification can be found at http://www.opendylan.org/books/drm/
which
should cover Dylan's version of generic function semantics pretty well.
There exist a couple of object systems for Scheme, many of which are
more or less derivatives of CLOS, or at least the generic function
approach. You can find a listing of them at
http://community.schemewiki.org/?object-systems
I hope this helps.
Best,
Pascal
--
1st European Lisp Symposium (ELS'08)
http://prog.vub.ac.be/~pcostanza/els08/
My website: http://p-cos.net
Common Lisp Do***ent Repository: http://cdr.eurolisp.org
Closer to MOP & ContextL: http://common-lisp.net/project/closer/


|