Fernando <···@NOSPAMeasyjob.net> wrote in message news:<··································@4ax.com>...
> Hi,
>
> Can someone please explain how CLOS selects the appropriate GF based on the
> types of the arguments? O:-)
This material is covered in the HyperSpec, 7.6.6 Method Selection and Combination.
Fernando wrote:
> Hi,
>
> Can someone please explain how CLOS selects the appropriate GF based on the
> types of the arguments? O:-)
Someone else already posted a link to the Common Lisp Hyperspec, which
will give you all the details of how it's specified to work. The
implementation details vary, of course, from one implementation to another.
The basic idea is that a generic function knows about an argument list
and some methods. When you call the generic function, it looks at the
actual arguments and figures out their types. Then it finds the method
that best matches that set of types and calls it with the actual arguments.
The HyperSpec better explains things like 'best matches' and 'figures
out their types' and so on.
Fernando <···@NOSPAMeasyjob.net> writes:
> Can someone please explain how CLOS selects the appropriate GF based on the
> types of the arguments? O:-)
You probably want to know about method selection and combination:
http://clhs.lisp.se/Body/07_ff.htm
--
Lars Brinkhoff, Services for Unix, Linux, GCC, HTTP
Brinkhoff Consulting http://www.brinkhoff.se/
Fernando wrote:
> Can someone please explain how CLOS selects the appropriate GF based on the
> types of the arguments? O:-)
This paper describes how it was done in PCL
http://www2.parc.com/csl/groups/sda/publications/papers/Kiczales-Andreas-PCL/for-web.pdf
Paul