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

Re: Revisiting smart match

Thread Previous | Thread Next
December 19, 2017 04:21
Re: Revisiting smart match
Message ID:
Karen Etheridge wrote:
>Why can't when_or_whatever_it_is(...) simply evaluate the expression
>inside, no matter what that expression is?

It does always evaluate it.  The question is then how it'll use the
value.  The old "when" sometimes uses the value as a truth value, and
sometimes uses it as a smartmatcher to apply to $_.  That's a layer of
confusion on top of the amazingly complex rules for smartmatch itself.
We've determined that both of these layers of confusion have to go.


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