develooper Front page | perl.perl6.language | Postings from July 2006

Re: ===, =:=, ~~, eq and == revisited (blame ajs!) -- Explained

Thread Previous | Thread Next
From:
Darren Duncan
Date:
July 14, 2006 12:55
Subject:
Re: ===, =:=, ~~, eq and == revisited (blame ajs!) -- Explained
Message ID:
p06230901c0dda69004cf@[192.168.1.101]
At 6:55 PM +0200 7/14/06, Dr.Ruud wrote:
>  >   say "foo" if $x !== $y;
>>
>>  into
>>
>>    say "foo" unless $x === $y;
>
>And how about symmetry:
>
>   say "foo" unless $y === $x;
>
>  > very unreliable.

Any equality or inequality operator is commutative, so it doesn't 
matter whether you have $x and $y or $y and $x, the result is the 
same.  So you can use whichever order you want without it needing to 
be coded for. -- Darren Duncan

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