From: Austin Ziegler Date: 2002-11-21T14:07:06+09:00 Subject: Re: Thoughts on Ruby On Thu, 21 Nov 2002 13:34:07 +0900, Thomas Gagn�wrote: > Yukihiro Matsumoto wrote: >> on 02/11/21, Thomas Gagn� 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