standardizing indentation

This commit is contained in:
Colin Jones 2010-07-26 18:20:42 -05:00
parent 2cf40290b9
commit 927212f253
3 changed files with 36 additions and 36 deletions

View File

@ -1,9 +1,9 @@
(meditations (meditations
"We shall contemplate truth by testing reality, via equality." "We shall contemplate truth by testing reality, via equality."
(= __ true) (= __ true)
"To understand reality, we must compare our expectations against reality." "To understand reality, we must compare our expectations against reality."
(= __ (+ 1 1)) (= __ (+ 1 1))
"You can test equality of many things" "You can test equality of many things"
(= (+ 3 4) __ (+ 2 __))) (= (+ 3 4) __ (+ 2 __)))

View File

@ -1,16 +1,16 @@
(meditations (meditations
"Sets are another important data structure in clojure" "Sets are another important data structure in clojure"
(= #{} (set nil)) (= #{} (set nil))
"Remember that a set is a 'set'" "Remember that a set is a 'set'"
(= __ (set '(1 1 2 2 3 3 4 4 5 5))) (= __ (set '(1 1 2 2 3 3 4 4 5 5)))
"You can ask clojure for the union of two sets" "You can ask clojure for the union of two sets"
(= __ (clojure.set/union #{1 2 3 4} #{2 3 5})) (= __ (clojure.set/union #{1 2 3 4} #{2 3 5}))
"And also the intersection" "And also the intersection"
(= __ (clojure.set/intersection #{1 2 3 4} #{2 3 5})) (= __ (clojure.set/intersection #{1 2 3 4} #{2 3 5}))
"But don't forget about the difference" "But don't forget about the difference"
(= __ (clojure.set/difference #{1 2 3 4 5} #{2 3 5}))) (= __ (clojure.set/difference #{1 2 3 4 5} #{2 3 5})))

View File

@ -1,27 +1,27 @@
(meditations (meditations
"You can use vectors in clojure to create an 'Array' like structure" "You can use vectors in clojure to create an 'Array' like structure"
(= __ (.size (vec nil))) (= __ (.size (vec nil)))
"You can create a vector in two ways" "You can create a vector in two ways"
(= [] (vec nil)) (= [] (vec nil))
"And populate it in either of these ways" "And populate it in either of these ways"
(= [1] (vec '(1))) (= [1] (vec '(1)))
"But you can populate it with any number of elements at once"
(= [1 __] (vec '(1 2)))
"And add to it as well"
(= __ (conj (vec nil) 333))
"You can get the first element of a vector like so" "But you can populate it with any number of elements at once"
(= :peanut (first [:peanut :butter :and :jelly])) (= [1 __] (vec '(1 2)))
"And the last in a similar fashion" "And add to it as well"
(= __ (last [:peanut :butter :and :jelly])) (= __ (conj (vec nil) 333))
"Or any index if you wish" "You can get the first element of a vector like so"
(= __ (nth [:peanut :butter :and :jelly] 3)) (= :peanut (first [:peanut :butter :and :jelly]))
"You can also slice a vector" "And the last in a similar fashion"
(= __ (subvec [:peanut :butter :and :jelly] 1 3))) (= __ (last [:peanut :butter :and :jelly]))
"Or any index if you wish"
(= __ (nth [:peanut :butter :and :jelly] 3))
"You can also slice a vector"
(= __ (subvec [:peanut :butter :and :jelly] 1 3)))