Python performance notes...

Daniel Berlin dan at cgsoftware.com
Sat May 27 17:48:06 EDT 2000


> 
> No, I meant that "map<string, vector<int>>" is an invalid piece of C++ --
> you have to use "map<string, vector<int> >". If I were making that up, it
> would be funny, but since Stroustroup made this one up, we can only mourn.

Right. I actually laughed when I read this, thinking "Oh, well then, that
makes it *easy* to parse, now that they did this".
Of the 8 billion things making C++ ambiguous, and very evil to parse, this
was the least annoying one.
I could understand it if he really thought you could parse C++ with 1 or 2
tokens of lookahead, but he had to know, with all the stupid hacks in the
grammar for compatibility reasons, that it was impossible, and thus, the
only reason for this syntax was to annoy people.

All the C++ parsers i've ever written (3 full parsers, at last count, 1
yacc, 1 ANTLR, 1 hand coded recursive descent) could handle it properly
even if you forgot to space it out.

--Dan





More information about the Python-list mailing list