# Immutable map - put / add

**URL:** https://discuss.kotlinlang.org/t/immutable-map-put-add/354
**Category:** Uncategorized
**Created:** [January 8, 2015, 6:58pm UTC](https://discuss.kotlinlang.org/t/immutable-map-put-add/354 "2015-01-08T18:58:22Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![kocka](https://avatars.discourse-cdn.com/v4/letter/k/e95f7d/32.png) [@kocka](https://discuss.kotlinlang.org/u/kocka)
#### Post date: [January 8, 2015, 6:58pm UTC](https://discuss.kotlinlang.org/t/immutable-map-put-add/354/1 "2015-01-08T18:58:22Z")

</div>

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

---

<div class="post-metadata">

### Author: ![abreslav](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/abreslav/32/8279_2.png) [@abreslav](https://discuss.kotlinlang.org/u/abreslav)
#### Post date: [January 11, 2015, 11:38am UTC](https://discuss.kotlinlang.org/t/immutable-map-put-add/354/2 "2015-01-11T11:38:20Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![kocka](https://avatars.discourse-cdn.com/v4/letter/k/e95f7d/32.png) [@kocka](https://discuss.kotlinlang.org/u/kocka)
#### Post date: [January 11, 2015, 2:34pm UTC](https://discuss.kotlinlang.org/t/immutable-map-put-add/354/3 "2015-01-11T14:34:29Z")

</div>

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

---

<div class="post-metadata">

### Author: ![kocka](https://avatars.discourse-cdn.com/v4/letter/k/e95f7d/32.png) [@kocka](https://discuss.kotlinlang.org/u/kocka)
#### Post date: [January 11, 2015, 2:37pm UTC](https://discuss.kotlinlang.org/t/immutable-map-put-add/354/4 "2015-01-11T14:37:10Z")

</div>

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