 
 
 
-(defn empty-machine
-  "defines a empty state machine which only goes from start->stop"
-  []
-  {:state :machina/start
-
-   :transitions {:machina/start [:machina/no-op :machina/stop]}})
-
-
-
-(defn configure-machine [sm fns]
-  (-> sm
-      ;; turn the list of states and transitions into a map
-      (update :transitions (fn [ts]
-                             (->> (map (fn [[s0 t s1]] [s0 [t s1]]) ts)
-                                  (into {}))))))
+(defn write-to-file [f]
+  (spit f
+        (str (java.util.Date.) \newline)
+        :append true))
+
+
+(comment
+  (defn empty-machine
+    "defines a empty state machine which only goes from start->stop"
+    []
+    {:state :machina/start
+
+     :transitions {:machina/start [:machina/no-op :machina/stop]}})
+
+
+
+  (defn configure-machine [sm fns]
+    (-> sm
+        ;; turn the list of states and transitions into a map
+        (update :transitions (fn [ts]
+                               (->> (map (fn [[s0 t s1]] [s0 [t s1]]) ts)
+                                    (into {})))))))
 
 
 ;;(configure-machine (empty-machine))



  (comment
    (play sm)
    (->> sm
         (iterate play)
         (take-while #(not= :machina/stop (:state %)))
         #_(map :data)
         last

              :on-failure (constantly :sleep)}


      :write-to-file {:fn*        (do! write-to-file)

                      :on-success (fn [sm] (println "OK")   (clojure.pprint/pprint sm) :sleep)
                      :on-failure (fn [sm] (println "FAIL") (clojure.pprint/pprint sm) :sleep)}}})
