[1086] in java-interest

home help back first fref pref prev next nref lref last post

Re: Yet more operator overloading & other trivia

daemon@ATHENA.MIT.EDU (Tako Schotanus)
Fri Aug 18 09:13:38 1995

Date: Fri, 18 Aug 95 12:08:16 +0200
To: kevin@elvis.wicat.com, java-interest@java.sun.com
From: Tako Schotanus <Tako.Schotanus@bouw.tno.nl>

At 11:19 17-08-95 MDT, kevin@elvis.wicat.com wrote:
>    Sorry to drag this out further (and I really doubt the Java folk at
>Sun care), but since I haven't got my two cents in yet, the debate can;t
>possible be over yet.

>    So, why does nobody seem to want this feature that is basically so
>similar to op-ov? I believe it is because most current programmers (OK,
>so I really mean "me and my circle of friends & co-workers") grew up
>with BASIC and procedural languages where keywords have always been
>sacred. From the first "10: PRINT$ Hello World" we have had reserved
>words that we had no ability to change. In other words, it is quite
>purely a cultural thing.

First of all, I think you can't compare the two, especially in an OO
language. Because if you look at it we always had a sort of OO if you
look at calculations: the +, -, * etc. are defined for their respective
types and could be seen as a call to an operator-method of that type.
(Additions of integers are handled differently than additions of floats,
so we already have some kind of overloading here).

Now OO languages come around and introduce objects. For an object you
can define methods and methods can be overloaded. Now in most OO
languages you also have some pre-defined methods, normally called
constructors and destructors (not all have these, of course ;),
are we not allowed to overload these because they are pre-defined?
Sure we can, that's the good thing about it! But we're still not allowed
to "overload" if or for or while. Why not? Well, what are the objects
they belong to? What possible use could there be in overloading them?
The only thing I can imagine is that you have a parser-object or
something similar that implements the parsing of a certain language
and you could use this to make a whole class of languages using it as
a base-class to work from. So maybe there *is* something to be said
for overloading if, for and while, but it would only apply to people
who are developing languages....

- Tako

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
_/               Tako Schotanus, TNO Bouwinformatica                    _/
_/   work: Lange Kleiweg 5, 2288 GH, Rijswijk, NL, tel: +31-15-842393   _/
_/       home: van Hasseltlaan 352, 2625 HZ, Delft, The Netherlands     _/
_/     E-mail: sst@bouw.tno.nl - URL: http://huizen.dds.nl/~quintess    _/
_/ Never let a dictator rule with peace; let peace rule like a dictator _/
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post