From: shibata.hiroshi@... Date: 2016-03-15T02:56:37+00:00 Subject: [ruby-core:74320] [Ruby trunk Misc#12122][Closed] Array Documentation (set intersection, union) Issue #12122 has been updated by Hiroshi SHIBATA. Status changed from Open to Closed Merged at r53958 ---------------------------------------- Misc #12122: Array Documentation (set intersection, union) https://bugs.ruby-lang.org/issues/12122#change-57440 * Author: Ryan Hosford * Status: Closed * Priority: Normal * Assignee: ---------------------------------------- **Set Intersection** * Most know what intersection means, but saying the operation excludes duplicates could be misleading (`[1] & [1]`, duplicates excluded, might mean a result of `[]`). * Instead, saying intersection returns the unique elements common to both arrays is more concise and less ambiguous. **Set Union** * The set union's documentation was incomplete in its describing preservation of order. Saying union preserves the order of the original array neglects the idea that the order of the elements in both arrays, as given, will be preserved. * Instead, saying set union preserves the order from the given arrays (and adding an example) fully demonstrates the idea. * Adds an example I think better demonstrates the preservation of order: `[ "c", "d", "a" ] | [ "a", "b", "c" ] #=> [ "c", "d", "a", "b" ]` Open PR: https://github.com/ruby/ruby/pull/1273 -- https://bugs.ruby-lang.org/ Unsubscribe: