Touch up some grammar & wording

This commit is contained in:
Colin Jones 2013-02-25 20:46:19 -06:00
parent 5dcf46a6b4
commit 7ab93a0c38
4 changed files with 10 additions and 9 deletions

View File

@ -1,8 +1,8 @@
(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"

View File

@ -1,15 +1,15 @@
(meditations (meditations
"There are a wide range of ways to generate a sequence" "There are many ways to generate a sequence"
(= __ (range 1 5)) (= __ (range 1 5))
"The range starts at the beginning by default" "The range starts at the beginning by default"
(= __ (range 5)) (= __ (range 5))
"It's important to only take what you need from a big sequence" "Only take what you need when the sequence is large"
(= [0 1 2 3 4 5 6 7 8 9] (= [0 1 2 3 4 5 6 7 8 9]
(take __ (range 100))) (take __ (range 100)))
"You can also limit results by dropping what you don't need" "Or limit results by dropping what you don't need"
(= [95 96 97 98 99] (= [95 96 97 98 99]
(drop __ (range 100))) (drop __ (range 100)))

View File

@ -17,16 +17,17 @@
(for [index __ :when (odd? index)] (for [index __ :when (odd? index)]
index)) index))
"And they trivially allow combinations of the two transformations" "Combinations these transformations is trivial"
(= '(1 9 25 49 81) (= '(1 9 25 49 81)
(map (fn [index] (* index index)) (map (fn [index] (* index index))
(filter odd? (range 10))) (filter odd? (range 10)))
(for [index (range 10) :when __] (for [index (range 10) :when __]
__)) __))
"More complex transformations can be formed with multiple binding forms" "More complex transformations simply take multiple binding forms"
(= [[:top :left] [:top :middle] [:top :right] (= [[:top :left] [:top :middle] [:top :right]
[:middle :left] [:middle :middle] [:middle :right] [:middle :left] [:middle :middle] [:middle :right]
[:bottom :left] [:bottom :middle] [:bottom :right]] [:bottom :left] [:bottom :middle] [:bottom :right]]
(for [row [:top :middle :bottom] column [:left :middle :right]] (for [row [:top :middle :bottom]
column [:left :middle :right]]
__))) __)))

View File

@ -2,7 +2,7 @@
"To split a collection you can use the partition function" "To split a collection you can use the partition function"
(= '((0 1) (2 3)) (__ 2 (range 4))) (= '((0 1) (2 3)) (__ 2 (range 4)))
"But watch out if there is not enough elements to form n sequences" "But watch out if there are not enough elements to form n sequences"
(= '(__) (partition 3 [:a :b :c :d :e])) (= '(__) (partition 3 [:a :b :c :d :e]))
"You can use partition-all to also get partitions with less then n elements" "You can use partition-all to also get partitions with less then n elements"