How can I use clojure.set in ClojureScript?
I always get a error.
(def middle-land (set (for [x water-hor
y (vec (clojure.set/difference (set (range 0 board-side))
(set water-ver)))]
[x y])))
ReferenceError: clojure is not defined
Seems you need to explicitly require the namespace to be able to use it:
ClojureScript:cljs.user> (ns core (:require clojure.set))
ClojureScript:core> (clojure.set/difference #{1 2} #{1 4}) ;=> #{2}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With