From: Alex Bowden
Sent: Thursday, September 07, 2000 6:52 AM
> Why don't the basic operators on the tuple objects return self rather than
void?
In Java palance, the 'void' return means the result comes back in 'this'
(the object on which the method was called).
> Maybe I'm using these wrongly but....
>
> I'd much rather say
>
> Point resultPoint = new
point3f(firstPoint3f).sub(secondPoint3f).scale(3.5)
So would I, give or take a few parentheses:
Point3f resultPoint = new
Point3f(firstPoint3f.sub(secondPoint3f).scale(3.5));
This looks ok to me. Never mind that Point3f - Point3f should be Vector3f,
but that belongs in my other rant.
> If you think that this doesn't matter then bear in mind that if the basic
numeric
> operators didn't return results then
>
> x = (- b + sqrt(b*b - 4*a*c)) / 2 * a
>
> in would look something like
>
>
> Number work1 = new Number(b)
> work1.times(b)
> Number work2 = new Number(4)
> work2.times(a)
> work2.times(c)
> work1.sub(work2)
> work1.sqrt()
> work1.sum(b)
> work1.divide(2)
> work1.divide(a)
You're fighting a lost battle in the lost war on operator overloading in
Java. It just ain't gonna happen. If we can't get overloading for Complex,
we ain't gonna get it for anything else. Deal with it. :-)
Cheers,
Fred Klingener
Brock Engineering
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".