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

Re: Revisiting smart match

Thread Previous | Thread Next
From:
Father Chrysostomos
Date:
November 27, 2017 22:21
Subject:
Re: Revisiting smart match
Message ID:
20171127222105.23782.qmail@lists-nntp.develooper.com
Zefram wrote:
> As an implementor, I'd be happy with separate keywords.  As a user,
> I'm unlikely to make much use of the switch keywords, so I'd like to
> hear from people who would use them often.

If we can make 'break' equivalent to 'next', then I will likely use
'when' frequently.  If we can make two separate keywords, I think I
will use it *very* frequently.  So I definitely support having separ-
ate keywords, as long as they are sufficiently memorable and not
confusing.

'when' and 'upon' are near synonyms.  It may be confusing at first,
but I could get used to it.  I have no opinion on which should be
which, if we go that route.

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'.

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