[1088] in java-interest

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

Re: Operator Overloading

daemon@ATHENA.MIT.EDU (Tom Wheeler)
Fri Aug 18 12:40:36 1995

Date: Fri, 18 Aug 95 08:36:21 EDT
From: tomw@intelligraphics.com (Tom Wheeler)
Reply-To: tomw@intelligraphics.com (Tom Wheeler)
To: java-interest@java.Eng.Sun.COM

>Here's an example from a commercial class library (I think it's
>more revolting than compelling).
>
>This is a snippet of code from some product literature for the
>Zinc Application Framework:
>
>    // Add the movie control window
>    *windowManager + new MOVIE_CONTROL;
>

Yes, this is a horrible example.  Obviously it should be

  *windowManager += new MOVIE_CONTROL;

because you are adding a new control to windowManager, not adding the
windowManager and the new control.  Although

  *windowManager << new MOVIE_CONTROL;

would probably be good too, meaning "insert a new control into the
windowManager".

I'm a proponent of operator overloading, but the above shows just how
silly you can get with it.


Regards,
Tom Wheeler
tomw@intelligraphics.com

-
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