operator [] method

MutableCell<V?> operator [](
  1. ValueCell key
)

Returns a cell which evaluates to the value of the entry with key key.

Changing the value of the returned cell, changes the value of the entry with key key in the Map held in this cell.

NOTE: The actual map is not modified but a new map is created.

Implementation

MutableCell<V?> operator [](ValueCell key) => (this, key).mutableApply((m, k) => m[k],
    (v) => value = _updatedMap(value, key.value, v as V),
    key: _MutableMapMethodKey(this, #indexOperator, key),
    changesOnly: true
);