 
 (def warn (partial lousy-logger :warn))
 
-(fact (warn "Red light ahead") => "red light ahead")
+(fact
+  (warn "Red light ahead")
+  => "red light ahead")
 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; complement -
+;; Why, thank you!
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (defn identify-humans-1
   [social-security-numbers]

  (take 10 (even-numbers))
  => '(0 2 4 6 8 10 12 14 16 18))


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; the collection abstraction:

;; sequence is about operating on members
;; collection is about operating operating on the structure as a whole.
;;  count, empty?,every?

(facts "about empty? operating on collections"
  (fact (empty? [])
    => true)
  (fact (empty? ["no!"])
    => false))

;; into
(facts "about into"
  (fact (map identity {:sunlight-reation "Glitter!"})
    => '([:sunlight-reation "Glitter!"]))
  (fact (into {} (map identity {:sunlight-reation "Glitter!"}))
    => {:sunlight-reation "Glitter!"}))

(facts "convert back to vector"
  (fact (map identity [:garlic :sesame-oil :fried-eggs])
    => '(:garlic :sesame-oil :fried-eggs))
  (fact (into [] (map identity [:garlic :sesame-oil :fried-eggs]))
    => [:garlic :sesame-oil :fried-eggs]))

(fact "convert back to list"

  (first (filter vampire?
                 (map vampire-related-details social-security-numbers))))

;; don't run when compiling or testing
;;(fact
;;  (time (identify-vampire (range 0 10000)))
;; ;; "Elapsed time: 32007.469024 msecs"
;;  => {:makes-blood-puns? true, :has-pulse? false, :name "Damon Salvatore"})

;; doall realizes all elements of a lazy sequence


;;;;;;;;;;;;;;;;;;;;;;
;; Infinite equences
;;;;;;;;;;;;;;;;;;;;;;

(fact "'repeat' infinite repeated sequence"
  (concat (take 8 (repeat "na")) ["Batman!"])
  => '("na" "na" "na" "na" "na" "na" "na" "na" "Batman!"))

;; repeates the output of a fucntion
;(take 3 (repeatedly (fn [] (rand-int 10))))
;; => (9 7 1)

(defn even-numbers
  "lazy infinite sequence of even numbers"
  ([] (even-numbers 0))
  ([n] (cons n (lazy-seq (even-numbers (+ n 2))))))

