Bug #7803

RDoc documentation: `Array#&` clarification

Added by Tsuyoshi Sawada about 1 year ago. Updated about 1 year ago.

Assignee:Zachary Scott
Target version:next minor
ruby -v: Backport:


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:


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


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.

Associated revisions

Revision 39415
Added by Zachary Scott about 1 year ago

  • array.c (rbarydiff, rbaryand, rbaryor): Document return order [RubySpec #7803


#1 Updated by Koichi Sasada about 1 year ago

  • Category set to doc
  • Assignee set to Zachary Scott
  • Target version set to next minor

#2 Updated by Zachary Scott about 1 year ago

  • Status changed from Open to Closed

Resolved by r39415

#3 Updated by Zachary Scott about 1 year ago

  • % Done changed from 0 to 100

#4 Updated by Yui NARUSE about 1 year ago

  • Tracker changed from misc to Bug

Also available in: Atom PDF