 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; The Library of Babel ;;; 
+;;; The Library of Babel ;;;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (defn kleene* [elements]

          (then
            (phrase [1/2 6/2 1/2 1/2 6/2 1/2 1/2 6/2 1/2 1/2 1/2 1/2 1/2 1/2 1/2 1/2 1/2]
                    [-17 nil -17 -17 nil -17 -17 nil -17 -10 -3 -11 -4 -12 -5 -13 -14])))
        harmony (phrase [32] [14])
        ]
    (->>
      (with bass accompaniment)
      (wherever :pitch, :pitch (comp scale/A scale/major))

  [string]
  (->> string (map int) (reduce + 0)))

(defmacro enterprise
  "Calculate the shortest string that is more complicated than the specified sym."
  [sym]
  `(let [source# (-> ~sym quote repl/source-fn)]
     (->> (babel)
       (drop-while #(<= (complexity %) (result-length source#)))
       first)))

(defn yo-dawg
  "I heard you like complexity, so I put some enterprise in your enterprise."
  []
  (enterprise enterprise))


;;;;;;;;;;;;;;;;
