[1061] in java-interest
Re: java-interest-digest V1 #121
daemon@ATHENA.MIT.EDU (Richard Morris)
Thu Aug 17 21:44:33 1995
Date: Thu, 17 Aug 1995 08:29:52 -0700
To: java-interest@java.sun.com
From: richard@zoom.com (Richard Morris)
> wrs@apple.com writes
>...
>The only "well-defined meaning" of + in C++ is that it adds two numbers of
>built-in types. That's it. (Even _that_ isn't very well defined, judging
>from the number of times I have to look at the type-conversion table.)
There are many instances where the language is less than complete, and
overloading operators causes no confusion. For example, in C++ one could
overload the + operator to add two complex numbers. This is a well defined
operation about which there should be no vagaries as to its meaning to a
reader of the code.
For example, I find it much easier to type type, think about, and evaluate
the expression (for variables xi, yi, zi
containing complex numbers)
"xi + yi + zi"
than
"add_two_complex_numbers(xi,add_two_complex_numbers(yi,zi))"
particularly when the expressions have more than trivial complexity.
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com