 (defn set-bmi [key val clear]
   (swap! bmi-data #(calc-bmi (merge % {key val, clear nil}))))
 
-(defn slider [{:keys [value key clear min max]}]
+(defn slider [{:keys [value min max param clear]}]
   [:div
    [:input {:type "range" :min min :max max :value value
             :style {:width "100%"}
-            :on-change #(set-bmi key (-> % .-target .-value)
+            :on-change #(set-bmi param (-> % .-target .-value)
                                  (or clear :bmi))}]])
 
 (defn bmi-component []

   created components, without resorting to React's lifecycle
   events."]])


(defn bmi-demo []
  [:div
   [:h2 "Simple BMI calculator"]
   [demo-component {:comp bmi-component
                    :defs [:ns :calc-bmi :bmi-data :set-bmi :slider
                           :bmi-component]}]])

(defn demo []
  [:div
   [:h1 "This will become a demo"]
   [intro]
   [managing-state]
   [bmi-demo]
   [:p "WIP"]])

                 (map #(% defs) names))))

(def builtins ["def" "defn" "ns" "atom" "let" "if" "when"
               "cond" "merge" "assoc" "swap!" "reset!"])

(defn syntaxify [src]
  (let [sep "\\][(){} \\t\\n"
        str-p "\"[^\"]*\""
        keyw-p (str ":[^" sep "]+")
        res-p (string/join "|" (map #(str % "(?=[" sep "])") builtins))
        any-p ".|\\n"
        patt (re-pattern (str "("
                              (string/join ")|(" [str-p keyw-p res-p any-p])
