Sebastian Hungerecker
11/7/2008 2:39:00 PM
Nick Bhanji wrote:
> My questions:
> 1. why is equal? listed in the methods for the array
> 2. what is the definition of equal? in the case of array?
> 3. why is there another function eql? performing the actual equal test
1. Where exactly is it listed? It's not listed in the docs for Array.
equal? is defined by Object and it is not overridden for any core class.
2. The same as for anything else: a.equal? b is true if and only if a and b
are actually the same object (i.e. both a and b point to the same location in
memory)
3. eql? does not perform the "actual equal test" - whatever that is. eql? is
to be used together with hash (and is indeed used that way by Hash, Set and
Array#&, Array#| and Array#-).
4. The method that I assume you're looking for is ==
HTH,
Sebastian
--
Jabber: sepp2k@jabber.org
ICQ: 205544826