Returns true iff rm is empty. O(1).
Returns the number of key-value pairs in rm. O(1).
Returns an arbitrary pair of rm. Specifically, on a nonempty replay map,
returns three values: an arbitrary key, its associated value, and true; on an empty one, returns
nil, nil, and false. O(1).
If rm is nonempty, returns, as three values, the first key that was added to rm, its
most recently associated value, and true. If rm is empty, returns nil, nil, and
false. O(log n).
If rm is nonempty, returns, as three values, the last (most recent) key that was added to
rm, its most recently associated value, and true. If rm is empty, returns nil,
nil, and false. O(log n).
Returns the index of x within the ordering of the keys of rm, or nil if it is not
found. NOTE: O(n).
Returns, as two values, the element at index idx within the ordering of rm and its associated value. Signals an error if idx is out of bounds. O(log n).
If v is not supplied, returns true iff the domain of rm contains k. If v is supplied, returns true iff rm maps k to v. O(log n).
Returns true iff the domain of rm contains k. (This is now redundant with two-argument
contains?, and is mildly deprecated. For most of FSet’s history, contains? on a map
required three arguments; so it was all but useless, and you had to use domain-contains?
instead. Fortunately, I finally came to my senses and fixed contains? to accept two
arguments.) O(log n).
If rm 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).
setf Expander: setf lookup (replay-map) rm k v ¶Invoked as (setf (lookup rm k) v). If the place rm (which must be
setf-able) holds a replay map, updates it to have a new mapping from k to v.
Equivalent to (setf rm (with rm k v)), except that subexpressions
within rm are evaluated only once.
You can also write (setf (@ rm k) v). See The @ Macro.
Returns a replay map, of the same class and organization as rm, that contains all pairs of rm whose key is not equal to k (according to its key comparison function), and also maps k to v. If rm did not already contain key k, k is appended to the map’s ordering. O(log n).
A modify macro that expands to with. If place rm
(which must be setf-able) holds a replay map, updates it so the map now maps k to
v.
Returns a map, of the same class and organization as rm, that contains all pairs of rm whose key is not equal to k. NOTE: O(n).
A modify macro that expands to less. If place rm
(which must be setf-able) holds a replay map, updates it so the map does not contain a key
k.
Returns a new map that has all the pairs of rm in the same order, but whose default is new-default. O(1).
setf Expander: default rm new-default ¶(setf (default rm) new-default) is equivalent to (setf rm
(with-default rm new-default)), except that subexpressions within rm are
evaluated only once.
Returns a new map that has all the pairs of rm in the same order, but has no default. O(1).
(clear-default rm) is equivalent to (setf rm (without-default rm)),
except that subexpressions within rm are evaluated only once.
Returns the domain (set of keys) of rm as a replay set of the same implementation, and using rm’s key ordering as its ordering. O(n), but with a relatively small constant factor.
Returns a stateful iterator over the map m, in replay order (the
order in which keys were first added). The :get operation returns three values: if there is
another key/value pair remaining, returns it as two values and a true third value, else two
nil values and false. Creating an iterator takes O(log n) time; the :get
operation is amortized O(1).
Returns a functional iterator over the map m, in replay order
(the order in which keys were first added). The :first operation returns three values: if
the iterator is not empty, returns the first key/value pair as two values and a true third value,
else two nil values and false. Creating an iterator takes O(log n) time; the
:first operation is O(1), and :rest is amortized O(1).