Damian Conway wrote:
>         (@foo,@bar,@zap) := part [/foo/, /bar/, /zap/], @source;

If we're worried about the distance between the source and destination
when there are many tests, maybe:

    part { /foo/ => @foo, /bar/ => @bar, /zap/ => @zap }, @source;

Or, 'long' formatted:

    part {
        /foo/ => @foo,
        /bar/ => @bar,
        /zap/ => @zap,
    }, @source;

Assuming the type system can handle that.  But people will forget the
comma before C<@source>, because it looks so similar to C<map>.  And
think of the { ... } as a code block, not a hashref.  Pffft.

I keep thinking we're missing something here.  This is just a
multi-streamed C<grep>, after all.  It should be easy.

Was it ever decided what C<for> would look like with multiple streams? 
Maybe we could just use the stream delimiters in the C<grep> like we do
in C<for>?

    grep {
        /foo/ -> @foo,
        /bar/ -> @bar,
        /zap/ -> @zap,
    } @source;

???

MikeL

Reply via email to