Re: inheritance bug?

Isaac Gouy <[email protected]> Tue, 24 Feb 2004 18:35:37 -0800 (PST)
Newsgroups gmane.comp.lang.nice.general
Message-ID <[email protected]>
> >Thus, define method will create a new generic function or extend an
> >old one, as needed."

> The problem is described in the C# article you linked to. If you
> later introduce a method with the same name in an imported package,
> you will suddenly override it silently, while you had no knowledge
> of that method when you wrote your implementation. So there is
> absolutely no guarantee that your implementation is meaningful for
> that method, that it fullfills its contract, ...

And when we would like move some method definitions to an interface
from class X, what can we do?

We have to define a method in the interface with a different name
"iMethodA", and provide an implementation of "iMethodA" for class X
which forwards to the method we really would like to use:
   iMethodA(X x) = x.methodA();

So we accumulate methods which are "code patches" as we work around
this restriction.


> One more, huge advantage, is that when you read the code, you 
> immediately see it's a overriding. You get more information, more 
> context to understand the code.

Not really, the context to understand the code in overridden methods
comes from seeing what the other implementations are. Any sane OO IDE
provides quick access to senders and implementors - don't LISP IDEs
bring together generic function implementations?

best wishes, Isaac

__________________________________
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click