Clojure-sortedset

提供:Dev Guides
移動先:案内検索

Clojure-ソートセット

要素のソートされたセットを返します。

構文

構文は次のとおりです。

(sorted-set setofelements)

パラメータ-「setofelements」は、ソートする必要がある要素のセットです。

戻り値-要素のソートされたセット。

以下は、Clojureのソート済みセットの例です。

(ns clojure.examples.example
   (:gen-class))
(defn example []
   (println (sorted-set 3 2 1)))
(example)

出力

上記のコードは次の出力を生成します。

#{1,2,3}