for (EXPR ; EXPR; EXPR ) BLOCK
Perl 6's version of that loop doesn't start with "for" since it uses "for" exclusively as an iterator of lists. However, if you happen to write a for loop as above, there is code in the standard Perl 6 parser that matches it and tells you what you did wrong and how to fix it. If you read the grammar for Perl 6, you find this sort of thing all over the place.
Perhaps it's just that Perl is in the unique position of having two major versions of the language that have significant differences in syntax and semantics that such extra parsing is almost required. But, I wonder how many other languages do this to the extent of Perl 6?
No comments:
Post a Comment