[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Do we have to worry about the names of generic functions?

From: Andy Wingo
Subject: Re: Do we have to worry about the names of generic functions?
Date: Fri, 14 May 2004 20:40:38 +0100

On Wed, 2004-05-12 at 12:14 -0400, Paul Jarc wrote:
> Andy Wingo <address@hidden> wrote:
> > Consider a generic, `output'. I assert that x.output() in Python does
> > not clobber the namespace.
> Agreed, because that name exists only within "x.".

I'm not sure this is true. Of course python people will agree with you,
but contrast it to the message-passing style of programming, where a
message only has meaning in as much as the recipient knows how to deal
with it. Likewise, output() only means something if `x' has an output
field, and generics only have meaning in as much as a method has been
specialized for a type.

If the generic has not been specialized for a certain type, it won't
apply. The corresponding situation would be if x (or a superclass)
doesn't define an output() method. I'm not clear on the difference,
except wrt collisions with non-generics, which I believe Andreas

There is still something inside me saying that modules should not be
exporting identifiers like 'field or 'parent. But logic's leading me the
other way!

Andy Wingo <address@hidden>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]