Project

General

Profile

Feature #17384

shorthand of Hash#merge

Added by tjdgnsqn133 (Kim Seonghoon) 3 months ago. Updated 3 months ago.

Status:
Feedback
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:101355]

Description

Hi, all.
When I used Hash#merge, I thought it is uncomfortable.

a = {k: 1}
b = {j: 2}
c = a.merge(b)

If hash provides + like array, so useful.


Related issues

Is duplicate of Ruby master - Feature #6225: Hash#+Rejectedmatz (Yukihiro Matsumoto)03/30/2012Actions

Updated by tjdgnsqn133 (Kim Seonghoon) 3 months ago

a = {k: 1}
b = {j: 2}
c = a.merge(b)
d = a + b # same as c
#2

Updated by shyouhei (Shyouhei Urabe) 3 months ago

Updated by shyouhei (Shyouhei Urabe) 3 months ago

  • Status changed from Open to Feedback

Please refer to previous discussions. Do you have some new insights around this area?

Updated by tjdgnsqn133 (Kim Seonghoon) 3 months ago

Thanks,
I didn't know the issue has been argued.
From now on, I search issues first before write.

Also available in: Atom PDF