develooper Front page | perl.perl5.porters | Postings from November 2017

Re: Revisiting smart match

Thread Previous | Thread Next
From:
Zefram
Date:
November 30, 2017 00:02
Subject:
Re: Revisiting smart match
Message ID:
20171130000154.GA12628@fysh.org
Tomasz Konojacki wrote:
>"where" and "via" are used by Moose::Util::TypeConstraints

Less critical, but still worth avoiding.

How about "because" as I proposed earlier, paired with a neologism "bewith"?

   given ($input) {
        because ($_ eq "string") { die "A" }
        because ($_ == 90210)    { die "B" }
        bewith (Number)          { die "C" }
    }

-zefram

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