Clojure - sorted-set
Returns a sorted set of elements.
Syntax
Following is the syntax.
(sorted-set setofelements)
Parameters − setofelements is the set of elements which need to be sorted.
Return Value − The sorted set of elements.
Example
Following is an example of sorted-set in Clojure.
(ns clojure.examples.example (:gen-class)) (defn example [] (println (sorted-set 3 2 1))) (example)
Output
The above code produces the following output.
#{1,2,3}
clojure_sets.htm
Advertisements