refer to clojure.set in 04

This commit is contained in:
Tom Marble 2015-06-14 21:38:41 -05:00
parent 6d5b226307
commit 54d4b1a999

View File

@ -1,5 +1,6 @@
(ns koans.04-sets
(:require [koan-engine.core :refer :all]))
(:require [koan-engine.core :refer :all]
[clojure.set :as set]))
(meditations
"You can create a set by converting another collection"
@ -12,10 +13,10 @@
(= __ (set '(1 1 2 2 3 3 4 4 5 5)))
"You can ask clojure for the union of two sets"
(= __ (clojure.set/union #{1 2 3 4} #{2 3 5}))
(= __ (set/union #{1 2 3 4} #{2 3 5}))
"And also the intersection"
(= __ (clojure.set/intersection #{1 2 3 4} #{2 3 5}))
(= __ (set/intersection #{1 2 3 4} #{2 3 5}))
"But don't forget about the difference"
(= __ (clojure.set/difference #{1 2 3 4 5} #{2 3 5})))
(= __ (set/difference #{1 2 3 4 5} #{2 3 5})))