mapAtPuttingCanDestroy

fun A_Map.mapAtPuttingCanDestroy(keyObject: A_BasicObject, newValueObject: A_BasicObject, canDestroy: Boolean): A_Map

Create a new map like this map, but with a new key/value pair as specified. If there was an existing key/oldValue pair, then it is replaced by the new key/value pair. The original map can be modified in place (and then returned) if canDestroy is true and the map is mutable.

Return

The new map containing the specified key/value pair.

Parameters

keyObject

The key to add or replace.

newValueObject

The value to associate with the key in the new map.

canDestroy

Whether the map can be modified in place if mutable.