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

Re: Revisiting smart match

Thread Previous | Thread Next
From:
Father Chrysostomos
Date:
November 29, 2017 14:20
Subject:
Re: Revisiting smart match
Message ID:
20171129142011.13578.qmail@lists-nntp.develooper.com
Ricardo Signes wrote:
>   given ($x) {                         
>     when   ($matcher) { ... }
>     ifcase ($_ > 100) { ... }
>   }

I could live with 'when' and 'where'.  We often say things like 'Take
them out when done, when golden-brown' but such phrases are less com-
mon with 'where' (though not entirely uncommon: 'where possible').

So:
    when ($matcher) { ... }
    where($_ > 100) { ... }

This also means that code using modules like Smart::Match can be writ-
ten to work with older and newer perl versions.

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