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

Re: Revisiting smart match

Thread Previous | Thread Next
From:
Eirik Berg Hanssen
Date:
December 19, 2017 13:51
Subject:
Re: Revisiting smart match
Message ID:
CAHAeAG4LggLyGwhi5fE8h2k0MCjmGcGu9G-8aU348NpGYqrH7Q@mail.gmail.com
On Tue, Dec 19, 2017 at 2:47 AM, Zefram <zefram@fysh.org> wrote:

> Craig A. Berry wrote:
> >whereas($input) {
>
> That's poor.  Per English meaning, the operand of "whereas" should be
> a condition, not a value, so it's totally unsuitable for this role.
>

  Yes.  It's a conjunction, expecting a clause, with a verb, not just a
noun phrase for matching.

  ... and that's a thought ... one preposition (with noun phrase, for
matching), and one conjunction (with clause, for truth-testing):

  upon ($baz) { do_stuff(); }
  do_stuff() upon $baz;

  when ($_->foo eq 'bar') { do_stuff(); }
  do_stuff() when $_->foo eq 'bar';

  ... or, you know, some of the other suggestions ...


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