Re: Generics vs. Message passing: object namespaces

"Joe Marshall" <[email protected]> Fri, 23 Feb 2007 19:16:55 -0800
Newsgroups gmane.comp.lang.lightweight
Message-ID <[email protected]>
On 2/23/07, [email protected] <[email protected]> wrote:
>
>    No.  Object1.foo and object2.foo select two entirely unentangled
> entities with object dispatch, if object1 and object2 are unrelated.
> Smashing *unrelated* methods together that happen to have the same
> name into a single entity is deeply wrong, conceptually, and bound to
> cause real problems in the real world as well.

Nonsense!  We are selecting a function based on two data: the runtime type
of the value of Object and the literal name `foo'.  The space of denotable
methods is Type * method-name.  How this is implemented is irrelevant.
Whether you have a table per type where each method is an entry in the
table, or if you have a table per method indexed by object type makes no
difference.

>    Generic dispatch forces a collision to occur and *create* a
> relationship where the programmer(s) intended none.

Huh?  If I have a generic function `foo' and define two completely unrelated
methods that work on two completely unrelated types, there is no way for
the methods to know about or invoke each other (at least not through normal
means).

>  The user must
> then explicitly disentangle this unwanted fender-bender.

What is there to disentangle?


-- 
~jrm