in reply to [perl 6] re reduction operators
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; }
|
|---|