Contains an implementation and API for an 'ordered set' data structure backed by a persistent vector.
Contains an implementation and API for an 'ordered set' data structure backed by a persistent vector.
(conj vset x)Returns a vector-set generated by inserting x into the appropriate position
in the sorted, distinct vector-set vset. The invariant is that if vset is
sorted and contains distinct elements, the return value will contain x and
also be sorted.
Attempting to insert an element x already contained in vset throws an
exception.
Returns a vector-set generated by inserting `x` into the appropriate position in the sorted, distinct vector-set `vset`. The invariant is that if `vset` is sorted and contains distinct elements, the return value will contain `x` and also be sorted. Attempting to insert an element `x` already contained in `vset` throws an exception.
(contains? vset x)Return true if the element x is present in the supplied vector vset, false
otherwise.
Return true if the element `x` is present in the supplied vector `vset`, false otherwise.
(difference x y)Returns a vector-set that contains all elements present in vector-set x and
NOT in vector-set y.
x and y must be vector sets, i.e., sorted and containing only distinct
entries.
Returns a vector-set that contains all elements present in vector-set `x` and NOT in vector-set `y`. `x` and `y` must be vector sets, i.e., sorted and containing only distinct entries.
(disj vset x)Returns a vector-set generated by dropping x from the supplied vector-set
vset. If x is not present in vset, acts as identity.
Returns a vector-set generated by dropping `x` from the supplied vector-set `vset`. If `x` is not present in `vset`, acts as identity.
(intersection x y)Returns a vector-set that contains all elements present in BOTH vector-sets x
and y.
x and y must be vector sets, i.e., sorted and containing only distinct
entries.
Returns a vector-set that contains all elements present in BOTH vector-sets `x` and `y`. `x` and `y` must be vector sets, i.e., sorted and containing only distinct entries.
(make xs)Returns a new vector-set, i.e., a vector with the distinct elements of the
supplied sequence xs stored in sorted order.
Returns a new `vector-set`, i.e., a vector with the distinct elements of the supplied sequence `xs` stored in sorted order.
(symmetric-difference x y)Returns a vector-set that contains all elements present in vector-set x and
vector-set y, but not in both.
x and y must be vector sets, i.e., sorted and containing only distinct
entries.
Returns a vector-set that contains all elements present in vector-set `x` and vector-set `y`, but not in both. `x` and `y` must be vector sets, i.e., sorted and containing only distinct entries.
(union x y)Returns a vector-set containing all elements present in either sequence x and
y.
Returns a vector-set containing all elements present in either sequence `x` and `y`.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |