Details
-
New Feature
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.0
-
None
Description
Provide a way to get the result of the "addition" of 2 Maps, eg:
assert [a:1, b:2] + [c:3] == [a:1, b:2, c:3]
In terms of Map semantics, which would take priority for duplicate keys, left or right?
Considering Java's Map.putAll(), which blindly adds all elements in the given map, perhaps the right side, should take precedence, so:
assert [a:1, b:1] + [b:2] == [a:1, b:2]
What do others think?
Original email thread: http://www.nabble.com/Map-addition-concatenation--tf3122652.html