ClojureDocs

Nav

Namespaces

sorted?

clojure.core

Available since 1.0 (source)
  • (sorted? coll)
Returns true if coll implements Sorted
2 Examples
user=> (sorted? (sorted-set 5 3 1 2 4))
true
user=> (sorted? (sorted-map :a 1 :c 3 :b 2))
true

;; Note you can't just pass in a collection that happens to be sorted.
user=> (sorted? [1 2 3 4 5])
false
=> (sorted? (sort [1 2]))
false
See Also

keyval => key val Returns a new sorted map with supplied mappings. If any keys are equal, they ...

Added by gstamp

Returns a new sorted set with supplied keys. Any equal keys are handled as if by repeated uses of...

Added by gstamp
0 Notes
No notes for sorted?