Bjarne Stroustrup has written a very interesting paper outlining some radical ideas for operator overloading: Generalizing Overloading for C++2000. He includes the notion of overloading no operator at all, so that "x y" can mean "x*y" the way physicists and mathematicians want it to mean.

Note: I got about halfway through this before realizing it was a joke...

tagged:   /   via: Borkware Miniblog» 7 reactions

Comments

[gravatar]
sil 8:10 PM on 11 Jan 2005

Let me guess...you realised it was a joke at the same point I did, which was when he stipulated that we were only allowed single-character identifiers because "we now have the full Unicode character set available"? :-)

[gravatar]
Mark 9:01 PM on 11 Jan 2005

I think it's a fairly interesting paper until you get to "Overloading Missing Whitespace" -- that's where it gets rather silly I think.

Still, even the composite operators idea sounds half-feasible... I wonder if anyone has ever tried it

[gravatar]
Ned Batchelder 9:37 PM on 11 Jan 2005

Sil: yes, that's exactly where he crossed the line for me!

[gravatar]
Bob 10:55 PM on 11 Jan 2005

Funny stuff. Some early clues: it starts off with a reference to an AT&T Tech report dated April 1, 1998. It also references a paper by an author named "Bjørn Stavtrup" from April 1988.

Bjarne isn't trying to hide anything here. Near the end he says that a preprocessor that implements this facility is available. The link makes it clear that this paper was April Fools joke. The ideas got so bizarre by that point that only the humor impaired would have taken it seriously.

He goes on to say that "several of the suggestions are technically feasible, but that doesn't mean that they would be good or that we have to implement them."

[gravatar]
Mike G. 7:45 AM on 12 Jan 2005

I originally read this (or a variant) in the Journal of Object Oriented Programming, in the March/April 1992 issue.

It's title there was "A proposal regarding invisible logic for object-oriented languages".

I got about a 1/4 of the way thru it, then went back, looked at the title again, and said "duh!" :)

[gravatar]
Alan Green 2:17 PM on 13 Jan 2005

I think the Perl 6 guys read this paper. Arbitrary unicode strings can be used as operators. The yen symbol is the 'zip' operator (because it looks like a half-open zipper.) http://dev.perl.org/perl6/synopsis/S03.html

[gravatar]
Ned Batchelder 2:23 PM on 13 Jan 2005

Yikes! And Perl is serious about it!

Add a comment:

name
email
Ignore this:
not displayed and no spam.
Leave this empty:
www
not searched.
 
Name and either email or www are required.
Don't put anything here:
Leave this empty:
URLs auto-link and some tags are allowed: <a><b><i><p><br><pre>.