On 9/19/06, Larry Wall <[EMAIL PROTECTED]> wrote:
But which *ect do we call the one that returns both?  One would like to
be able to say:
    @stuff.direct(
        { .wanted } ==> my @accepted;
        default     ==> my @rejected;
    );
Well, sure, but at that point you've moved beyond the realm of
greppish stuff and into more mappish stuff, IMO.

Anyway, it's not clear to me that grep always has an exact opposite.
Standard Larry-disclaimer applies ("you've Thought about this a lot
more than I have, but...")

It seems to me that grep takes a list and returns a subset of that
list, so its opposite (along one possible axis of opposition, anyway)
would be something that returns the difference between the original
list and the returned subset.  If you're returning something else,
it's no longer grep.  (Of course, the block you pass in to grep can
have other side effects, which may not have an "opposite", but that's
to me a separate issue).

Also, how is grep intended to work in P6?  I had just sort of assumed
that it took any sort of value as a criterion and smart-matched
against it, but pugs currently requires a block...

--
Mark J. Reed <[EMAIL PROTECTED]>

Reply via email to