Issue #5185 has been updated by trans (Thomas Sawyer).


Adding #update is a good idea.

I would also add a warning to #merge stating that it's behaviour will change in a future version and to use #update instead. Then after a little while obsolete #merge altogether, but only for a bit, then bring it back with expected behaviour of producing new Set.

I advocate a slightly accelerated time scale for this transition b/c if some people are making the mistake of assuming Set#merge works like Hash's already and finding out the hard way that it's not, then I think that adds some impetus to taking the fast track.

----------------------------------------
Feature #5185: Set#merge acts in place but Hash#merge does not
https://bugs.ruby-lang.org/issues/5185#change-26681

Author: trans (Thomas Sawyer)
Status: Assigned
Priority: Normal
Assignee: knu (Akinori MUSHA)
Category: lib
Target version: 2.0.0


Waste of brain cells to have to learn and recall they are different. The expected method would be Set#merge!, Set#merge would return a new Set instance.

OTOH, why not Set#concat ? Or conversely, Array#merge ?




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