Feature #8458

Array#merge/merge!

Added by Boris Stitnicky 11 months ago. Updated 11 months ago.

[ruby-core:55186]
Status:Rejected
Priority:Normal
Assignee:-
Category:-
Target version:-

Description

Very simple method can be defined:

class Array
def merge! other
require 'activesupport/all' # can't use #tap, see #8457
tail = extract
options!
othertail = other.extractoptions!
concat( other ) << tail.update( other_tail )
end
end

When pondering about where this method should dwell, it seemed to me, perhaps in the core itself? Am I deluding myself?

History

#1 Updated by Yukihiro Matsumoto 11 months ago

  • Status changed from Open to Rejected

Generally speaking, arrays are not argument lists. This method is specific to argument lists.
Thus Array is not the right place for the method.

Matz.

#2 Updated by Boris Stitnicky 11 months ago

Still, many thanks for [:A, :B, C: 1] syntax, I was very happy to discover it!

matz (Yukihiro Matsumoto) wrote:

Generally speaking, arrays are not argument lists. This method is specific to argument lists.
Thus Array is not the right place for the method.

Matz.

Also available in: Atom PDF