though it's not terribly functional to use temporary bindings like that. If we made optional parameters not "eat" values from the list then we could do a lookahead:my $s; for [\~] 1..* { last if .chars >= 1_000_000; $s := $_; }
or some such...my $s = first gather for [\~] 1..* -> $x, $y? { take $x if $y.chars >= 1_000_000; }
In reply to Re: [perl 6] re reduction operators
by TimToady
in thread [perl 6] re reduction operators
by blazar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |