On Tuesday, November 5, 2002, at 01:40 PM, Damian Conway wrote:
Interesting... We still have "step" to deal with, as well, so I'd like to figure out how to throw all this together into one basket, if possible. (I know it's reaching, I'm just trying to extend this as far as it'll go.)As Buddha Buck suggested elsewhere, and as I have coded above, I would imagine that this functionality would be mediated by pairs and merged into a single C<zip> function. So that last example is just:for zip(@a=>2,@b=>1) -> $x,$y,$z { ... }
So how could we say "take 2 elements from @a, stepping 10 indices at a time, plus one from @b"? One obvious way is adverbially, but we have two possible adverbs:
for @a:{ by => 2, step => 10 } ; @b -> $x, $y, $z { ... }
.... which is perhaps ugly, but unambiguous.
The point being that I don't know how we associate more than one adverb with a construct, or if we can. But it would seem profoundly useful in situations like this one.
MikeL