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

Re: Revisiting smart match

Thread Previous | Thread Next
From:
Eirik Berg Hanssen
Date:
November 28, 2017 00:45
Subject:
Re: Revisiting smart match
Message ID:
CAHAeAG6e4SLMKR9BM9do_+_nWjzN1Fr+=mp_U0=hqffKQRw+=w@mail.gmail.com
On Mon, Nov 27, 2017 at 11:21 PM, Father Chrysostomos <sprout@cpan.org>
wrote:

> Another suggestion, which may not be any good, is to use 'when'
> for truth:
>
>     when($quality eq 'so-so') { ... }
>
> and 'beit' (be it) for smartmatch:
>
>     beit(numerical) { ... }
>
> In English, we already combine those two words in 'albeit'.
>

  FWIW, I like it!

  Unlike anything I could come up with, this is unambiguous as to which is
which: Only when the topic ("it") is explicit in the keyword, is the topic
($_) implicit in the following expression.

  The only thing I can hold against it is, well, might the subjunctive be
too much for the non-linguist programmer?


Eirik

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