On Thu, 21 Nov 2002 13:34:07 +0900, Thomas GagnñØrote:
> Yukihiro Matsumoto wrote:
>> on 02/11/21, Thomas Gagné¼tgagne / wide-open-west.com> writes:
>>| What about equality (Smalltalk's ==)?
>> equal?
> := assignment
> = equality (they are equal objects)
> == identity (they're both the *same* object)
> 
> I should have used identity. Is there (a need for) an equivalent
> in Ruby?

c:\home\Projects\Ruby> ri equal?
---------------------------------------------------------- 
Object#equal?
     obj.equal?( anObject ) -> true or false
----------------------------------------------------------------------
--
     Returns true if obj and anObject have the same object ID. This
     method should not be overridden by subclasses.
        a = [ 'cat', 'dog' ]
        b = [ 'cat', 'dog' ]
        a == b         #=> true
        a.id == b.id   #=> false
        a.eql?(b)      #=> true
        a.equal?(b)    #=> false

-austin
-- Austin Ziegler, austin / halostatue.ca on 2002.11.21 at 00.04.09