diff --git a/src/hottub/stm.clj b/src/hottub/stm.clj index 32881b2..0c5e753 100644 --- a/src/hottub/stm.clj +++ b/src/hottub/stm.clj @@ -153,12 +153,12 @@ (case (count body) 0 [[] [nil]] 1 [[] body] - body) + [(first body) (next body)]) params (if (< (count params) numargs) (into params (repeatedly (- numargs (count params)) #(gensym))) params)] - [params exprs])) + (concat [params] exprs))) (defn call-stmfunc [fn opts args statenext] (let [stm (first args) @@ -166,7 +166,7 @@ args (if (:pass-next-state opts) (concat args [statenext]) args) result (apply fn args) stm (if (:returns-value opts) (goto stm (state stm) result) (or result stm)) - stm (if (:advances opts) (goto stm statenext (value stm)))] + stm (if (:advances opts) (goto stm statenext (value stm)) stm)] stm)) (defn- handler-matches [stm handler event]