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

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

Thread Previous
From:
David Golden
Date:
August 16, 2012 15:19
Subject:
Re: fixing smartmatch just hard enough (and when, too)
Message ID:
CAOeq1c9pFXuAkvUjPnveO3ViyvNCpptJu+rLHmUvEB8ZyL6j-g@mail.gmail.com
On Thu, Aug 16, 2012 at 5:58 PM, Ricardo Signes
<perl.p5p@rjbs.manxome.org> wrote:
> ## The New ~~ Operator

+1

> ## Core Junctions

+1 (maybe more)

> ## Backcompat and ~~

/me shrugs.  Maybe just rip the band-aid off and get it over with.

> ## Fixing given and when

+0.5 → because when({...}) is darn ugly nesting.  Since a naked "when"
(without a test) is illegal, could we get this syntax working?

    when (...) {...} # smart-match
    when {...} {...} # code-ref
    when {...}       # syntax error

-- david

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