                   (catch Throwable e
                     (warn e (str child " threw"))
                     (if-let [ex-stream *exception-stream*]
-                      (ex-stream (exception->event e)))
-                  )
-                )
-              )
+                      (ex-stream (exception->event e))))))
               children
-              child-arities
-            )
-          ))))))
+              child-arities)))))))
 
 (defmacro changed-state
   "Passes on changes in state for each distinct host and service."

        children (if (map? options)
                   (rest children)
                   children)
        child-arities (map #(alength (.getParameterTypes (first (.getDeclaredMethods (class %))))) children)]
    
    (fn stream [event]
      (let [kept (swap! previous (comp (partial take 2)
                                       #(conj % event)))]
        (when-not (every? (partial = (pred event)) (map pred kept))
          (dorun
            (map 
              (fn [child arity]
                (try
                  (if (= 1 arity)


  ; Assume states *were* ok the first time we see them.
  (changed :state {:init \"ok\"} prn)

  ; Receive the previous event, in addition to the current event
  (changed :state
           (fn [prev-evt evt]
             (prn \"changed from\" (:state prev-evt) \"to\" (:state evt))))

  Note that f can be an arbitrary function:

