develooper Front page | perl.perl5.porters | Postings from August 2012

Re: fixing smartmatch just hard enough (and when, too)

Thread Previous | Thread Next
From:
Jesse Luehrs
Date:
August 22, 2012 08:15
Subject:
Re: fixing smartmatch just hard enough (and when, too)
Message ID:
20120822151515.GV11137@tozt.net
On Wed, Aug 22, 2012 at 11:06:15AM -0400, David Golden wrote:
> On Wed, Aug 22, 2012 at 10:58 AM, Jesse Luehrs <doy@tozt.net> wrote:
> 
> > I agree - I'm curious to see what the actual use cases for this table
> > element are, since it's the one part of this proposal that I'm still
> > kind of questionable about.
> >
> 
> I assume it's for junctions:
> 
>   when ( any(@a) ~~ $b ) { ... }

So maybe what we really want is to move that case down below the "Any ->
Code" case. If $b is a coderef, I'd expect it to be called with the
junction, rather than calling the ~~ overload on the left hand side. I
can see any(@a) ~~ $b making sense for the case where $b is a regex or
plain scalar.

-doy

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About