new tasks
This commit is contained in:
parent
2a4d27cea0
commit
80737d5a6a
1194 changed files with 15353 additions and 1 deletions
3
Task/Collections/Clojure/collections-2.clj
Normal file
3
Task/Collections/Clojure/collections-2.clj
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
'(1 4 7) ; a linked list
|
||||
(list 1 4 7)
|
||||
(cons 1 (cons 4 '(7)))
|
||||
3
Task/Collections/Clojure/collections-3.clj
Normal file
3
Task/Collections/Clojure/collections-3.clj
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
['a 4 11] ; somewhere between array and list
|
||||
(vector 'a 4 11)
|
||||
(cons ['a 4] 11) ; vectors add at the *end*
|
||||
3
Task/Collections/Clojure/collections-4.clj
Normal file
3
Task/Collections/Clojure/collections-4.clj
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
#{:pig :dog :bear}
|
||||
(assoc #{:pig :bear} :dog)
|
||||
(set [:pig :bear :dog])
|
||||
4
Task/Collections/Clojure/collections.clj
Normal file
4
Task/Collections/Clojure/collections.clj
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{1 "a", "Q" 10} ; commas are treated as whitespace
|
||||
(hash-map 1 "a" "Q" 10) ; equivalent to the above
|
||||
(let [my-map {1 "a"}]
|
||||
(assoc my-map "Q" 10)) ; "adding" an element
|
||||
Loading…
Add table
Add a link
Reference in a new issue