3 ms·
Perl 6 changed the syntax of the ternary conditional operator for other reasons: less ambiguity of syntax, for one. (If you're really curious about the reasoni
by chromatic 18y ago
Perl 6 changed the syntax of the ternary conditional operator for other reasons: less ambiguity of syntax, for one. (If you're really curious about the reasoning, I believe Apocalypse 3 "Operators" explains.)
The interesting question is whether Perl 6 can slough off syntactic baggage from C and Perl 5 for the purpose of clarity and attract more new programmers. I believe the changes from regular expressions to grammars demonstrate the viability of this concept.
- snorkel 18y agoI'm sorry but if every programming language out there uses ?: then that's not ambiguous at all.
- scott_s 18y agoPerhaps he meant the ambiguity of parsing?
- chromatic 18y agoIndeed, and not just for the compiler's parser. I don't believe that Algol-family syntax is the best representation for source code. Nor do I believe that of S-expressions. I believe it's possible to produce a consistent syntax that's understandable and maintainable (and linguistically justifiable) for a modestly skilled practitioner of the art. Internal consistency of Perl 6 is more important -- even to novices learning the language -- than consistency with other languages, even Perl 5. Many of the linguistic and syntactic quirks of Perl 5 came from other languages. Not all -- but many.