Adriano Ferreira a.r.ferreira-at-gmail.com |Perl 6| wrote:
On Sat, May 3, 2008 at 4:00 PM, John M. Dlugosz
<[EMAIL PROTECTED]> wrote:
I've searched the archives, but did not see a good explanation of what eqv
does, and what is meant by snapshotting in the description of the synopses.
Can anyone explain it (with examples?) or point to an existing treatment,
please?
I think the best explanation so far is at Synopsis 03, section
"Comparison Semantics"
http://feather.perl6.nl/syn/S03.html#Comparison_semantics
"
Binary |eqv| tests equality much like |===| does, but does so with
"snapshot" semantics rather than "eternal" semantics. For top-level
components of your value that are of immutable types, |eqv| is identical
in behavior to |===|. For components of your value that are mutable,
however, rather than comparing object identity using |===|, the |eqv|
operator tests whether the canonical representation of both subvalues
would be identical if we took a snapshot of them right now and compared
those (now-immutable) snapshots using |===|.
"
That's exactly what I find lacking. Hence the desire to find someone to
explain that, and then write a better description to file away for
future use.
--John