develooper Front page | perl.perl5.porters | Postings from September 2015

Re: smartmatch needs your eyes

Thread Previous | Thread Next
From:
Eric Brine
Date:
September 10, 2015 20:04
Subject:
Re: smartmatch needs your eyes
Message ID:
CALJW-qHsAtPfOn48eh6zN0b61BGF90Jg4cYOZ0Nf6um0QKs6Dg@mail.gmail.com
On Thu, Sep 10, 2015 at 11:26 AM, Ricardo Signes <perl.p5p@rjbs.manxome.org>
wrote:

>   # Why do we warn on smart match in void?  smart match can have side
> effects
>   # like capturing or whatever the subroutine does.  I'm not sold on this
>   # warning. -- rjbs, 2015-09-09
>   # $_ ~~ \&test;
>

So can `$_ eq $obj`, yet we want that to warn. I don't believe we want C++
where `<<` can do anything; we still expect `~~` to perform a smart match
even if the specific definition of that is customizable.

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