 (fact (sum-times2' 1 2 3)
   => 12)
 
+
 ;;;;;;;;;;;;;;;;;;;;
 ;; memoization
+;;;;;;;;;;;;;;;;;;;;
 
 (defn sleepy-identity
   "returns the given value after a 1 second 'calculation'"

  [text]
  (s/replace (s/trim text) #"lol" "LOL"))

(fact (clean "My boa constrictor is so sassy lol!  ")
  => "My boa constrictor is so sassy LOL!")

(fact "pretty common style"
  ((comp s/lower-case s/trim) " Unclean string ")
  => "unclean string")


(defn two-comp
  [f g]
  (fn [& args]
    (f (apply g args))))

(def my-lower-trim (two-comp s/lower-case s/trim))

(fact (my-lower-trim " Unclean string  ")
  => "unclean string")

(def sum-times2 (two-comp  #(* 2 %) +))

(fact (sum-times2 1 2 3)
  => 12)

;; define a new version of 'comp'
(defn my-comp
  [f & funs]
  (if (empty? funs) f
      (recur (fn [& args]
                 (f (apply (first funs) args)))
               (rest funs))))

(fact ((my-comp s/lower-case s/trim) " Unclean string ")
  => "unclean string")
(fact ((my-comp s/reverse s/lower-case s/trim) " Unclean string ")
  => "gnirts naelcnu")

(def sum-times2' (two-comp  #(* 2 %) +))

  [filename]
  (analysis (slurp filename)))  ;; slurp is not a function

;;(System/getProperty "user.dir")
;;(analyze-file "project.clj")
;;=> "Character count: 423"


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; living with immutable data structures
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defn no-mutation
  [x]
