ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
It is a good paper from Stroustrup the creator of C++. I first read it in paper form in my hard back copy of The C++ Programming Language and used it a few times since for really odd ball problems.
Uh, that's non-standard, and completely different from what smeezekitty was talking about. I hope that *never* shows up in C++, it trades an easy parse error for a nasty missing operator error. Also it's a lot less clear because it breaks the ingrained training of C's lexing and grammar rules.
Uh, that's non-standard, and completely different from what smeezekitty was talking about. I hope that *never* shows up in C++, it trades an easy parse error for a nasty missing operator error. Also it's a lot less clear because it breaks the ingrained training of C's lexing and grammar rules.
News flash, this is in c also as it is what is used to create lex'ed combo operators for Logic.
And the comment to Smeeze was about his incorrect statement that the return type being on the line above the rest of the function def was wrong as white space doesn't delimit code in c or c++.
Hmm, did anyone notice Stroustrup's whitespace overloading paper was an April fool joke ?
Oh yeah.. totally missed that. Haha, it's almost plausible enough to actually be serious. I really should have checked when he started mentioning Unicode characters..
Quote:
funny thing is that is how it started and ended up in the ISO99 standard for c and c++
That's blatantly wrong, overloading whitespace is definitely non-standard, especially the non-context-free lex extension (actually, good lex rules are regular expressions, but I'm being lax here). If you really want to prove it otherwise, write an example that'll compile in Comeau.
ow.cpp:2: error: expected identifier before '\x20'
ow.cpp: In function `int main()':
ow.cpp:4: error: expected `)' before numeric constant
ow.cpp:5:2: warning: no newline at end of file
Hmm, did anyone notice Stroustrup's whitespace overloading paper was an April fool joke ?
I have to admit, the first time I read that a few years ago I was halfway through writing a post about how preposterous the idea was by the time read the "April fools" part...
Kevin Barry
PS On the other hand, one would think overloading operator , would be just as ridiculous, yet it's perfectly valid...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.