Sets the collection element associated with a particular key.
Alters mutable-collection so that the value associated with key will subsequently be new-value. If mutable-collection is stretchy, element-setter may also change its size (for example, by adding new keys with values).
An error is signaled if a program calls element-setter with a key that is not already a key to the collection, unless the collection is stretchy.
Stretchy collections allow element-setter to be called with a key that is not present in the collection, expanding the collection as necessary to add a new element in that case. Each concrete subclass of <stretchy-collection> must provide or inherit a method for element-setter that behaves as follows when there is not already an element present for the indicated key:
open
| new-value | An instance of <object>. |
| mutable-collection | An instance of <mutable-collection>. |
| key | An instance of <object>. |
| new-value | An instance of <object>. |
Sets the collection element associated with a particular key. | |
The class <table> provides an implementation of element-setter for use by its subclasses. |
The class <table> provides an implementation of element-setter for use by its subclasses. If no element with the given key exists, element-setter will add the key and new-value to the table.