At the moment I'm leaning toward:


and going the other way

    $thing ~~ $pattern

and most generally, something like:


By the way, the Pattern type is already called Selector in the
synopses.  Or perhaps Selector is a bit more general.  Arguably Pattern
is the role that defines .accepts and .rejects,  but Selector is
really the Pattern|Junction type you use in a signature.  But we can't
just have Pattern does Junction or everything turns into a junction.  :/

Or maybe they should be the other way around, where Selector is the role
and Pattern is the sig type.  Or maybe the sig type should be Where so
we can say

    multi grep (Where $where, [EMAIL PROTECTED]) {...}

and call it with :where{...} or where => {...}.  Selector is kind of
a stupid name in any event.

Anyway, that gives us:

    given $pattern {
        when .accepts(42) {...}

which given typical usage patterns of switch statements is probably
adequately huffmanized, unless we want to go for something shorter
than accepts/rejects, like


Of course, all of the .rejects() variants could simply be spelled
.accepts().not, but that seem unnecessarily cruel.


Reply via email to