Re: Generics vs. Message passing: object namespaces

Steve Dekorte <[email protected]> Sun, 25 Feb 2007 17:38:37 -0800
Newsgroups gmane.comp.lang.lightweight
Message-ID <[email protected]>
On 25 Feb 2007, at 04:33 am, Pascal Costanza wrote:
> On 25 Feb 2007, at 05:01, Steve Dekorte wrote:
>> On 24 Feb 2007, at 10:04 am, Mike Newhall wrote:
>>> At 11:59 AM 2/24/2007 +0000, Tom Locke wrote:
>>>> In practice, programmers using object-dispatch languages have no
>>>> difficulty understanding where a call is going when the see  
>>>> something
>>>> like "file.name". Yes the namespace is implicit rather than  
>>>> explicit,
>>>> but people are good at context! Honestly, this is a BIG reason why
>>>> people like object-dispatch. It is. Honestly.
>>
>> And not knowing the type isn't just an unwanted side-effect, it's  
>> actually the goal. Dynamic OO is about escaping from fragile and  
>> inflexible type dependencies by using type independent messages  
>> instead of type dependent functions.
>
> You still haven't told us how you disambiguate the draw message  
> when your object inherits both from a weapon and a picture.  
> Especially when both draw messages have the same signature.

Pascal,

If you're asking me, it depends on the particular object model. IMO,  
a proper object model has a non-ambiguous lookup path. For example,  
in Io, the object looks in itself, then in it's protos list in a  
depth first order. So there is no confusion with regards to finding  
slots - the first in the lookup path is always the one found.

Also, the slot name is the only thing that matters - all signatures  
in Io are effectively the same (they are pass variable object lists  
and return one object). And there is no notion of globals - all  
lookups start at the message receiver (which may be a locals object)  
and proceed from there.

- Steve