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 27, 2012 02:18
Subject:
Re: fixing smartmatch just hard enough (and when, too)
Message ID:
20120827091804.GP11137@tozt.net
On Mon, Aug 27, 2012 at 02:14:07AM -0700, Klaus wrote:
> On 26 août, 21:52, spr...@cpan.org (Father Chrysostomos) wrote:
> > Ricardo Signes wrote:
> > The three advantages to smart match I’ve seen are:
> > • Junctive operations: ~~ @foo
> > • Accepting qr// or sub{} from the caller and using it on the rhs
> > • when(3) which is nice and short.
> 
> I would like to add the following case (so we don't have to write
> "any"):
> 
> • when(3, 4, 5)
> (-- used to be when([3, 4, 5]) --) which is nice and short and stands
> for:
> • when(any(3, 4, 5))

These are exactly the kinds of arbitrary special cases that we are
trying to eliminate.

-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