Immutable map - put / add


#1

Hi all,

What is the shortest/best way of creating an immutable map from another immutable map plus a new element possibly overriding an element?
Is there a reason why the + - operators are not supported?

Regards,
Laszlo


#2

Side note: those are not immutable maps, but read-only maps. They may be mutated elswhere, but the reference we are holding does not permit mutation.


#3

Ah yes indeed, read-only is a better expression.


#4

Meanwhile, I have registered a feature request for this: https://youtrack.jetbrains.com/issue/KT-6594