[#46908] [ruby-trunk - Bug #7774][Assigned] IFUNC上のbinding呼び出しでSEGV — "ktsj (Kazuki Tsujimoto)" <kazuki@...>

16 messages 2013/02/03

[#47075] [ruby-trunk - Bug #7924][Open] r39232 以降 net/http で正しく reponse を取得出来ないケースがある — "hsbt (Hiroshi SHIBATA)" <shibata.hiroshi@...>

15 messages 2013/02/23

[ruby-dev:46953] [ruby-trunk - RubySpec #7803][Open] RDoc documentation: `Array#&` clarification

From: "sawa (Tsuyoshi Sawada)" <sawadatsuyoshi@...>
Date: 2013-02-08 06:39:01 UTC
List: ruby-dev #46953
Issue #7803 has been reported by sawa (Tsuyoshi Sawada).

----------------------------------------
RubySpec #7803: RDoc documentation: `Array#&` clarification
https://bugs.ruby-lang.org/issues/7803

Author: sawa (Tsuyoshi Sawada)
Status: Open
Priority: Normal
Assignee: 
Category: 
Target version: 


In the RDoc documentation for `Array#&`, it does not mention whether the order of the elements in the returned array preserves the order in the receiver. There is a question raised regarding this point in stackoverflow:

    http://stackoverflow.com/questions/14764135/is-order-preserved-in-arrays-when-intersection-is-done

and it mentions that that is included in the test for RubySpec

    https://github.com/rubyspec/rubyspec/blob/master/core/array/intersection_spec.rb#L16

so it looks like that is taken for granted, but it is not guaranteed. If it is indeed a feature, then that should be written in the document. If not, (meaning the order might not be preserved in a future implementation), then that should also be mentioned in the document as a warning. The documentation for `Array#-` makes that point clear:

    Array Difference---Returns a new array that is a copy of the original array, removing any items that ...

so, perhaps the docmentation for `Array#&` should be written along the same line.


-- 
http://bugs.ruby-lang.org/

In This Thread

Prev Next