On Wed, Dec 11, 2002 at 02:15:40PM -0800, Michael Lazzaro wrote:
> On Wednesday, December 11, 2002, at 11:16  AM, Luke Palmer wrote:
> >This brings up something that's been on the tip of my toungue for
> >awhile.  In many object-oriented languages we have seen that there is
> >an important difference between "equal" and "same."  Perl already has
> >two kinds of equal, but IIRC there is nothing to test whether two
> >variables refer to the same place in memory.  Should there be?
> 
> After thinking about it a little more, I'll set myself on the "yes" 
> side.  And propose either '===' or ':=:' to do it.

Given that this will not be a commonly used feature, I wouldn't give it a
special operator.  Just use a method.

      $foo.sameas $bar;
      %foo.sameas %bar;
      @foo.sameas @bar;

> >   $obj1 eq $obj2;    # [1] are their stringifications identical?
> >   $obj1 == $obj2;    # [2] are their numifications identical?
> >   $obj1 === $obj2;   # [3] are they in fact the same object?


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>    http://www.pobox.com/~schwern/
Perl Quality Assurance      <[EMAIL PROTECTED]>         Kwalitee Is Job One
Funny thing about weekends when you're unemployed.  They don't mean quite
so much 'cept you get to hang out with your workin' friends.
        - Primus "Spaghetti Western"

Reply via email to