From: "robin850 (Robin Dupret)" Date: 2012-08-15T18:03:19+09:00 Subject: [ruby-core:47209] [ruby-trunk - Bug #6872] Array does not specify how it determines uniqueness of values Issue #6872 has been updated by robin850 (Robin Dupret). Hello, I allow myself to make a patch containing documentation : https://github.com/robin850/ruby/compare/enhance_documentation I have just a question : I was looking in the code in order to see if some methods use Object#hash when comparing elements and I found the rb_ary_eql method. Why this one doesn't end with the _p suffix ? Is there any reason please ? Have a nice day. ---------------------------------------- Bug #6872: Array does not specify how it determines uniqueness of values https://bugs.ruby-lang.org/issues/6872#change-28888 Author: agrimm (Andrew Grimm) Status: Open Priority: Normal Assignee: drbrain (Eric Hodel) Category: DOC Target version: ruby -v: ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.4.0] =begin The documentation of (({Array#uniq})) , and similar methods, does not specify how values are determined to be unique when a block is not given. The Stack Overflow answer http://stackoverflow.com/a/8779948/38765 explains that (({Array#uniq})) works on the basis of looking at the hash method of each value in the array. However, this is not explained in the documentation of (({Array#uniq})) , or in (({Object#hash})) . I think, but I'm not 100% sure, that there are other methods in Array that also use the hash method, such as (({Array#-})) . Ideally, all of these methods should be documented as using the hash method. =end -- http://bugs.ruby-lang.org/