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

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

Thread Previous | Thread Next
From:
Jonathan Lang
Date:
July 13, 2006 21:55
Subject:
Re: ===, =:=, ~~, eq and == revisited (blame ajs!) -- Explained
Message ID:
ef30550b0607132155o482ee05ex642811d0dab2a2b6@mail.gmail.com
David Green wrote:
> I think I understand it... (my only quibble with the syntax is that
> === and eqv look like spin-offs of == and eq, but I don't know what
> to suggest instead (we're running short of combinations of = and : !))

Agreed.

> So there are three basic kinds of comparison: whether the variables
> are the same (different names, but naming the same thing); whether
> the values are the same (deep comparison, i.e. recursively all the
> way down in the case of nested containers); and in-between (shallow
> comparison, i.e. we compare the top-level values, but we don't work
> out *their* values too, etc., the way a deep comparison would).  If
> I've got it right, this is what =:=, eqv, and === give us,
> respectively.

Apparently, there are _four_ basic kinds of comparison: the ones
mentioned above, and == (I believe that eq works enough like == that
whatever can be said about one in relation to ===, =:=, or eqv can be
said about the other).  I'd be quite interested in an expansion of
David's example to demonstrate how == differs from the others.

-- 
Jonathan "Dataweaver" Lang

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