P is for Practical | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Actually Perl 6 is even harder to (statically) parse than Perl 5, because it is much easier to change the syntax.
You can, for example, introduce new operators very easily:
This will define an unary prefix operator that takes one string as an argument. When somebody writes
You can't know if that's a method call or a call to an operator. You'd think it makes no difference - but wait until precedence comes into the play:
If that foo parsed as a sub call the precedence is lower than that of the concatenation ~, and the other way round if it's parsed as an operator. This is quite a complicated example, but there are much easier ones with "real" macros. (But since no implemenation really implements macros by now, I don't really know much about them). In reply to Re^3: Perl Cannot Be Parsed: A Formal Proof
by moritz
|
|