Skip to main content

set-node

function

rewrite-clj.node/set-node

(set-node [children])
Create a node representing a set with `children`. ```Clojure (require '[rewrite-clj.node :as n]) (-> (n/set-node [(n/token-node 1) (n/spaces 1) (n/token-node 2) (n/spaces 1) (n/token-node 3)]) n/string) ;; => "#{1 2 3}" ``` Note that rewrite-clj allows the, technically illegal, set with duplicate values: ```Clojure (-> (n/set-node [(n/token-node 1) (n/spaces 1) (n/token-node 1)]) (n/string)) ;; => "#{1 1}" ``` See [docs on sets with duplicate values](/doc/01-user-guide.adoc#sets-with-duplicate-values).

No examples yet. Be the first to add one!