Returns a set of the distinct elements of coll.
;; returns distinct elements user=> (set '(1 1 2 3 2 4 5 5)) #{1 2 3 4 5} ;; returns distinct elements (different nomenclature) user=> (set [1 1 2 3 2 4 5 5]) #{1 2 3 4 5} user=> (set [1 2 3 4 5]) #{1 2 3 4 5} user=> (set "abcd") #{\a \b \c \d} user=> (set '("a" "b" "c" "d")) #{"a" "b" "c" "d"} user=> (set {:one 1 :two 2 :three 3}) #{[:two 2] [:three 3] [:one 1]} user=> (set nil) #{}
(set [1 2 3 2 1 2 3]) -> #{1 2 3} #{:a :b :c :d} -> #{:d :a :b :c} (hash-set :a :b :c :d) -> #{:d :a :b :c} (sorted-set :a :b :c :d) -> #{:a :b :c :d} ;------------------------------------------------ (def s #{:a :b :c :d}) (conj s :e) -> #{:d :a :b :e :c} (count s) -> 4 (seq s) -> (:d :a :b :c) (= (conj s :e) #{:a :b :c :d :e}) -> true (s :b) -> :b (s :k) -> nil
Returns a new hash set with supplied keys. Any equal keys are handled as if by repeated uses of c...
Returns a new sorted set with supplied keys. Any equal keys are handled as if by repeated uses of...
conj[oin]. Returns a new collection with the xs 'added'. (conj nil item) returns (item). (co...
When passed 2 rels, returns the rel corresponding to the natural join. When passed an additional k...
Return a set that is the first set without elements of the remaining sets
Returns a map of the distinct values of ks in the xrel mapped to a set of the maps in xrel with th...
Returns a rel of the maps in xrel with the keys in kmap renamed to the vals in kmap
Returns the map with the keys in kmap renamed to the vals in kmap
disj[oin]. Returns a new set of the same (hashed/sorted) type, that does not contain key(s).
Returns a lazy sequence of the elements of coll with duplicates removed. Returns a stateful transd...
The documentation doesn't mention the order, is it undefined?
-> #{:d :a :b :c}
Sets are a core data structure that by definition do not store elements in a sorted order. The actual order will ultimately be determined by the specific hashing function underpinning the data structure.
Is the order guaranteed to be consistent if so is it not ordered (just not asc/desc)?