Returns true iff rs is empty. O(1).
Returns the number of elements in rs. O(1).
Returns an arbitrary element of rs. Specifically, on a nonempty replay set, returns two values: an arbitrary element and true; on an empty one, returns two false values. O(1).
If rs is nonempty, returns its first element (the first one added to it) and a true second
value; otherwise, nil and false. O(1).
If trs is nonempty, returns its last element (the one most recently added to it) and a true
second value; otherwise, nil and false. O(1).
Returns the index of x within the ordering of rs, or nil if it is not found.
NOTE: O(n).
Returns the element at index idx within the ordering of rs. Signals an error if idx is out of bounds. O(log n).
Returns true iff x is an element of rs. O(log n).
If rs contains x, returns two values, true and the element found; else false and
nil. (This is useful for canonicalizing instances; the element found may be a different
instance from x.) O(log n).
Returns a replay set, of the same class and organization as s, that contains all elements of s and also x. If s did not already contain x, x is appended to the set’s ordering. O(log n).
A modify macro that expands to with. If place rs
(which must be setf-able) holds a replay set, updates it to contain x.
Returns a set, of the same class and organization as rs, that contains all elements of rs except x. NOTE: O(n).
A modify macro that expands to less. If place rs
(which must be setf-able) holds a replay set, updates it not to contain x.
Iterates over s, adding each of its elements to rs, and returning the final value of rs. That is, if s is itself a replay set, its elements that are not already in rs will be added in order to the end of rs. O(size(s) log size(rs)).
Iterates over rs, retaining each of its elements that is also in s. That is, the result contains the elements that are in both sets, in the order in which they appear in rs. O(size(rs) log size(s)).
Returns a stateful iterator over the set, in replay order (the order in
which elements were first added). The :get operation returns two values: if there is another
element remaining, returns it and a true second value, else nil and false. Creating an
iterator takes O(log n) time; the :get operation is amortized O(1).
Returns a functional iterator over the set, in replay order (the order
in which elements were first added). The :first operation returns two values: if the
iterator is not empty, returns the first element and a true second value, else nil and false.
Creating an iterator takes O(log n) time; the :first operation is O(1), and :rest
is amortized O(1).