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

Re: Revisiting smart match

Thread Previous | Thread Next
November 27, 2017 19:12
Re: Revisiting smart match
Message ID:
Father Chrysostomos wrote:
>    foo when ?bar;

That encroaches on the territory of expression syntax.  We don't currently
have any expression syntax that begins with a question mark, but we
used to.  It's not appealing to rule out inventing some in the future,
just for this.  The same minus "used to" goes for the other punctuation
characters with which this is possible.

>starting to sound like the old 'Perl doesn't need a switch' meme,

That's true, and I for one am content with elsif chains.  But it is
Perlish to support a variety of styles.

>which actually reads quite well.  But you cannot easily combine that
>with 'when' without the forgot-the-break problem.

Right, and I think that mixing problem is why we can't answer the need
for truth-value "when" with "just use if".


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About