I wrote a description of all these comparison operators without getting bogged down in immutable types, snapshots, etc. and stuck with ordinary usage and how it corresponds with what we have in other languages.

Please see my page and comments are welcome.

—John

Replies are listed 'Best First'.
Re: Perl 6 mini-essay: eqv, ===, =:=, etc.
by TimToady (Parson) on May 05, 2008 at 21:03 UTC
    In Summary table column 1, s/evq/eqv/.

    Also, your smartmatch is wrong on the array case, where P5 and P6 differ. In P6 you must say any(@list), or you're asking if $x matches the entire list (where you are presuming that $x is some other listy object).

      That makes sense. any can be used with other comparison operators and doesn't need the smartmatcher to apply the iteration.

      I changed the example to use a hash, which is still interesting. I wonder if anything is left that is really doing more than knowing which part to test or which comparison to use. I take that as a good sign, of separation of features.

      —John

Re: Perl 6 mini-essay: eqv, ===, =:=, etc.
by Anonymous Monk on May 05, 2008 at 14:45 UTC

    From the article, regarding the =:= operator:

    It tells you whether two names are aliased to the same symbol.

    What's the difference between a name and a symbol?

      I was not speaking formally, but the idea is that a symbol is the thing itself (the things in the symbol table), and it may be referred to by different names, or even no name at all if it is anonymous.

      More formally, =:= is used to compare item containers, since normally anything you do to an item drops through to the item in the container. $x =:= $y is just a shortcut for VAR($x) === VAR($y).

      —John

        In perl 5, these were called "thingies". Until the 3rd edition of the Camel, where they became the pedestrian "referents".
Re: Perl 6 mini-essay: eqv, ===, =:=, etc.
by Anonymous Monk on May 05, 2008 at 03:27 UTC
      Gee, if I had wanted to do that, I would have. I would also have PREVIEWED the result to make sure it wasn't munged.

      Moderator: please delete this post.