Generalizing Overloading for C++2000

Tuesday 11 January 2005This is close to 20 years old. Be careful.

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...

Comments

[gravatar]
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]
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]
Sil: yes, that's exactly where he crossed the line for me!
[gravatar]
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]
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]
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]
Yikes! And Perl is serious about it!

Add a comment:

Ignore this:
Leave this empty:
Name is required. Either email or web are required. Email won't be displayed and I won't spam you. Your web site won't be indexed by search engines.
Don't put anything here:
Leave this empty:
Comment text is Markdown.