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

Re: smartmatch needs your eyes

Thread Previous | Thread Next
From:
H.Merijn Brand
Date:
September 10, 2015 15:43
Subject:
Re: smartmatch needs your eyes
Message ID:
20150910174224.54a273ca@pc09.procura.nl
On Thu, 10 Sep 2015 11:26:08 -0400, Ricardo Signes
<perl.p5p@rjbs.manxome.org> wrote:

> As a reminder, and adding one small change, the new behavior is:
> 
>   # STEP ONE
    $x ~~ 42        -->     $x == 42        ???
    $x ~~ "foo"     -->     $x eq "foo"     ???
>   $x ~~ $qr       -->     $x =~ $qr
>   $x ~~ /.../     -->     $x =~ /.../
>   $x ~~ sub{...}  -->     $sub->($x)
>   $x ~~ undef     -->     ! defined $x
>   $x ~~ obj       -->     uses ~~ overloading if present, otherwise pass
> 
>   # STEP TWO
>   $obj ~~ $x      -->     uses ~~ overloading if present, otherwise pass
> 
>   # STEP THREE
>   $x ~~ $y        -->     fatal

-- 
H.Merijn Brand  http://tux.nl   Perl Monger  http://amsterdam.pm.org/
using perl5.00307 .. 5.21   porting perl5 on HP-UX, AIX, and openSUSE
http://mirrors.develooper.com/hpux/        http://www.test-smoke.org/
http://qa.perl.org   http://www.goldmark.org/jeff/stupid-disclaimers/

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