In response to a question about ad hoc overloading:

On Thursday, May 20, 1999 9:10 AM, Nigel Perry [SMTP:[EMAIL PROTECTED]] wrote:
>
> So to answer the question: it can be done, by a simple existance proof :-)
> 

Of course it *can* be done, but *should* it be done?

Uncontrolled overloading means that when you see a function application you can't
immediately see what function is being applied - you see its name but not its 
semantics, because
there may be many different functions with the same name. 

Obfuscating the program source in this way presents a risk of error, and is bad 
language engineering.

What would be gained by allowing ad hoc overloading? If operations on different types 
have similar meaning
there is a case for defining a new class. If you have existing different functions 
with similar names you can 
qualify them to avoid the ambiguity. When else would you want this feature?

--brian


Brian Boutel
Phone +64  4 9386709 Fax +64 4 9386710  Mobile 021 410142
[EMAIL PROTECTED]



Reply via email to