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

Re: Smartmatch two cents (was... List::Util... when...)

Thread Previous
From:
Klaus
Date:
June 30, 2012 01:09
Subject:
Re: Smartmatch two cents (was... List::Util... when...)
Message ID:
82e061c6-24e8-4c3f-a18b-870f7dedd5fc@z19g2000vbe.googlegroups.com
On 29 juin, 23:05, aa...@priven.com (Aaron Priven) wrote:
> On Fri, Jun 29, 2012 at 12:15 PM, Klaus <klau...@gmail.com> wrote:
> > On 29 juin, 12:54, e...@waniasset.com (Ed Avis) wrote:
> > > I would gladly remove smartmatch from my code if Perl provided
> > > an 'in' keyword
> > > to replace it, which is the only thing I use smartmatch for anyway.

> > I agree with your statement, but the problem is that there is always
> > something to be added,

[...]

> I do think in_eq and in_== would be useful, and with when_true, when_eq,
> and when_== would cover nearly all the actual uses of smartmatch in
> practice.

That sounds very reasonable to me. I suggest that we use this as a
proposal to the perl5.porters community to develop a new smartmatch /
given...when.


Thread Previous


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