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

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

Thread Previous | Thread Next
Darren Duncan
July 13, 2006 22:57
Re: ===, =:=, ~~, eq and == revisited (blame ajs!) -- Explained
Message ID:
At 10:36 PM -0700 7/13/06, Jonathan Lang wrote:
>So the purpose of === is to provide a means of comparison that doesn't
>implicitly coerce its arguments to a particular type?

Yes, absolutely.  The === takes 2 arguments exactly as they are, 
without changing anything, and says if they are two appearances of 
the same value.  It would always return false if the 2 arguments are 
of different declared types.  And if they are of the same types, then 
no coersion is necessary in order to compare them for equality.

Now, I didn't see them yet anywhere in Synopsis 3, but I strongly 
recommend having negated versions of all these various types of 
equality tests.  Eg, !== for ===, nev for eqv, etc.  They would be 
used very frequently, I believe (and I have even tried to do so), and 
of course we get the nice parity.

-- Darren Duncan

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