Multiple dispatch (Re: [squeak-dev] The Inbox: Kernel-cmm.464.mcz)

Frank Shearar frank.shearar at angband.za.org
Sun Jun 20 17:15:03 UTC 2010


On 2010/06/20 18:32, Igor Stasenko wrote:
> Best reference about multiple dispatch can be found in Slate language.
>
> http://files.slatelanguage.org/doc/pmd/ecoop.pdf
>
> in short, it is not about varargs but about looking up for a method
> based on a set of behaviors(objects) of message arguments.

Yes, that was Michael's point - that what Brent's talking about is 
possibly _not_ multiple dispatch.

frank

> in smalltalk a lookup function takes two arguments:
>
> F(selector ,  receiver class)
>
> with multiple dispatch a lookup function can take any number of arguments:
>
> F(selector ,  receiver, arg1 , arg2 .. )
>
> so, effectively, if method is unary, then you have a single dispatch,
> as in smalltalk, since
> arguments count == 1 (receiver is implicit argument), and if there are
> more than 1 argument,
> then lookup function using properties of every or subset of message
> arguments to find a method.
>
> On 20 June 2010 17:38, Michael Haupt<mhaupt at gmail.com>  wrote:
>> Hi,
>>
>> On Sun, Jun 20, 2010 at 4:11 PM, Frank Shearar
>> <frank.shearar at angband.za.org>  wrote:
>>>> Since Smalltalk does not support multi-methods, it is essential that the
>>>> caller of a method can pass arguments in multiple formats to the same
>>>> method and have them correctly interpreted by the implementation.
>>> ...
>>> (I assume you are talking about multiple dispatch - method lookup using not
>>> just the receiver but also the types of the parameters to a selector, like
>>> Common Lisp's generic functions?)
>>
>> looks more like varargs to me ...
>>
>> Best,
>>
>> Michael
>>
>>
>
>
>




More information about the Squeak-dev mailing list