Note that although you can use either lookup or lookup! to retrieve a value from a
transient map, and either default or default! to read its default, only the forms
ending in ! can be used as a setf place.
Returns true iff trm is currently empty. O(1).
Returns the current number of elements in trm. O(1).
Returns an arbitrary element of the current contents of trm. Specifically,
on a nonempty map, returns three values: an arbitrary key, its value, and true; on an empty map,
returns nil, nil, and false. O(1).
If trm is nonempty, returns, as three values, the first key that was added to trm, its
most recently associated value, and true. If trm is empty, returns nil, nil,
and false. O(log n).
If trm is nonempty, returns, as three values, the last (most recent) key that was added to
trm, its most recently associated value, and true. If trm is empty, returns nil,
nil, and false. O(log n).
Returns the index of x within the ordering of the keys of trm, or nil if it is
not found. NOTE: O(n).
Returns, as two values, the key at index idx within the ordering of trm and its associated value. Signals an error if idx is out of bounds. O(log n).
Returns true iff key is currently a key of trm, and if value is supplied, it is the corresponding value. O(log n).
Removes all key/value pairs from trm, resetting it to the empty state. O(1).
Modifies trm so that it maps key to value. Has no effect if this was already the case. Returns trm. O(log n).
Modifies trm so that it does not contain a mapping for key. Has no effect if this was already the case. Returns trm. O(log n).
If trm currently contains a key equal to k, according to its key comparison function, returns three
values: the corresponding value, true, and the key found; otherwise, the map’s default, false, and nil. If the key is not found and the map has no default,
signals an error of type map-domain-error. O(log n).
Invoked as (setf (lookup! trm key) value). Modifies trm so that it
maps key to value. Has no effect if this was already the case. Returns value
(the CL spec for setf requires this). O(log n).
Returns the default associated with trm.
Invoked as (setf (default! trm) new-default). Changes the default associated
with trm to new-default.
Removes the default from trm. Subsequent lookups using keys not in the domain of trm will cause an error to be signalled.
Returns a persistent FSet ch-replay-map (the usual kind, with functional semantics) with the
contents of trm. Subsequent modifications to the transient are permitted, and of course will
not affect the persistent one.
This operation has two modes, depending on copy?. If copy? is false (the default), it takes O(1) time; but subsequent modifications to the transient will behave performance-wise as if a new transient had been created. If copy? is true, the operation takes O(n) time, but subsequent modifications to the transient will run at full speed. Copying the collection also compacts it, so it uses less heap space.