Peter Scott wrote:
>
> for my($x, $y, $z) (@list) { ... }
> ...
> IANAPE (I Am Not A Parsing Expert). So I thought I would see if anyone who
> was could say whether this construct would really give the parser problems
> or whether looking ahead for the block will disambiguate.
Well, I think it's likely that the perl6 parser would be made to
handle this; but even if not, it shouldn't be too hard to get it
to allow a ref to such a list:
for [ $x, $y, $z ] ( @list ) { ...
for \@iters ( @list ) { ...
Btw, I hope that operators like C<for> will also be properly prototyped
in perl6. I expect that would mean that prototyping will be sufficiently
beefed up; including optional and alternative cases. Hmm, maybe something
regex-like would be needed: sub my(($|\@)?@&); Heh.
You know, I would like to pass code blocks in any arg position;
I want sub foo(&\@&\@&) to be callable as
foo { alpha() } @bravo { charlie() } @delta { echo() };
No C<sub>s, no commas.
--
John Porter
We're building the house of the future together.