Returns true iff tb is currently empty. O(1).
Returns the total multiplicity of the current elements of tb. O(1).
Returns the number of unique elements currently in tb; that is, the size of a set containing its elements. O(1).
Returns an arbitrary element of the current contents of tb. Specifically, on a nonempty bag, returns two values: an arbitrary element and true; on an empty bag, returns two false values. O(1).
If tb currently contains x, returns two values, its multiplicity and the instance found;
else 0 and nil. O(log n). (The lookup method is provided as a convenience;
because it is provided, you can also use the @ macro.)
Returns true iff x is currently an element of tb. O(log n).
Removes all elements from tb, resetting it to the empty state. O(1).
Modifies tb so that it contains value. Has no effect if this was already the case. Returns tb. O(log n).
Modifies tb so that it does not contain value. Has no effect if this was already the case. Returns tb. O(log n).
Returns a persistent FSet ch-bag (the usual kind, with functional semantics) with the
contents of tb. 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.