RESUME would have many uses. For example, to put commas in the right places
in a printed list:
for @list -> @value {
print $value;
RESUME {print ', ';} #If this were NEXT we would print an extra comma at
the end.
LAST {print "\n";}
}
RESUME could also be useful for maintaining state information, such as loop
iteration or running sum, between loop iterations:
for @data -> $value {
state $index will first {$_ = 0;} will resume {++$_;}
state $sum will first {$_ = $value;} will resume {$_ += value;}
...
}
Joe Gottman
So RESUME would be to FIRST as NEXT is to LAST?
--
Jonathan "Dataweaver" Lang
It's like the SATs all over again...
Sage