Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
15
Task/Set/Clojure/set.clj
Normal file
15
Task/Set/Clojure/set.clj
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
(require 'clojure.set)
|
||||
|
||||
; sets can be created using the set method or set literal syntax
|
||||
(def a (set [1 2 3 4]))
|
||||
(def b #{4 5 6 7})
|
||||
|
||||
(a 10) ; returns the element if it's contained in the set, otherwise nil
|
||||
|
||||
(clojure.set/union a b)
|
||||
|
||||
(clojure.set/intersection a b)
|
||||
|
||||
(clojure.set/difference a b)
|
||||
|
||||
(clojure.set/subset? a b)
|
||||
Loading…
Add table
Add a link
Reference in a new issue