ajwang / groovypptest

Automatically exported from code.google.com/p/groovypptest
0 stars 0 forks source link

Map<->FHashMap interoperability #361

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
map+fmap //-
fmap+map //-
map.putAll(fmap)
fmap.putAll(map)

Original issue reported on code.google.com by gromop...@gmail.com on 29 Mar 2011 at 11:08

GoogleCodeExporter commented 8 years ago

Original comment by alex.tka...@gmail.com on 29 Mar 2011 at 11:13

GoogleCodeExporter commented 8 years ago
What is expected result of map +/- fmap?

there are two options either map or newFmap

Original comment by alex.tka...@gmail.com on 29 Mar 2011 at 11:21

GoogleCodeExporter commented 8 years ago
The type of the first operand. This seems to be the most logical alternative

Original comment by gromop...@gmail.com on 29 Mar 2011 at 11:46

GoogleCodeExporter commented 8 years ago
So it is old map, right?

Original comment by alex.tka...@gmail.com on 29 Mar 2011 at 12:34

GoogleCodeExporter commented 8 years ago
On both. For old map, injected via something like DefaultGroovyPPMethods

Original comment by gromop...@gmail.com on 29 Mar 2011 at 1:01

GoogleCodeExporter commented 8 years ago
fmap + map will always create new fmap. but what do u want to have for map + 
fmap? It can be either map after addition of elements in fmap or completely new 
map combining elements from both

May be we simply need to do map << fmap instead for putting in to old one and + 
for creating join. It will be exactly as in DGM for normal Map

Original comment by alex.tka...@gmail.com on 29 Mar 2011 at 4:05

GoogleCodeExporter commented 8 years ago
+ should surely create a new map, it's not expected to have side effects

Original comment by gromop...@gmail.com on 29 Mar 2011 at 4:09