diff --git a/README.md b/README.md index 20ca43c..7a3660b 100644 --- a/README.md +++ b/README.md @@ -175,17 +175,22 @@ Besides scalar values, lifecycle functions can take anonymous functions, partial (defn- pf [n] (+ 41 n)) +(defn fna [] + 42) + (defstate scalar :start 42) (defstate fun :start #(inc 41)) (defstate with-fun :start (inc 41)) (defstate with-partial :start (partial g 41)) (defstate f-in-f :start (f 41)) +(defstate f-no-args-value :start (fna)) +(defstate f-no-args :start fna) (defstate f-args :start g) (defstate f-value :start (g 41 1)) (defstate private-f :start pf) ``` -Check out [fun-with-values-test](https://github.com/tolitius/mount/blob/958d7e345c9ad0983d30d44af9d852fe8d2d0bcc/test/check/fun_with_values_test.clj) for more details. +Check out [fun-with-values-test](https://github.com/tolitius/mount/blob/0.1.5/test/check/fun_with_values_test.clj) for more details. ## The Importance of Being Reloadable diff --git a/test/check/fun_with_values_test.clj b/test/check/fun_with_values_test.clj index 96eecf1..f1f4772 100644 --- a/test/check/fun_with_values_test.clj +++ b/test/check/fun_with_values_test.clj @@ -12,11 +12,16 @@ (defn- pf [n] (+ 41 n)) +(defn fna [] + 42) + (defstate scalar :start 42) (defstate fun :start #(inc 41)) (defstate with-fun :start (inc 41)) (defstate with-partial :start (partial g 41)) (defstate f-in-f :start (f 41)) +(defstate f-no-args-value :start (fna)) +(defstate f-no-args :start fna) (defstate f-args :start g) (defstate f-value :start (g 41 1)) (defstate private-f :start pf) @@ -28,6 +33,8 @@ #'check.fun-with-values-test/with-partial #'check.fun-with-values-test/f-in-f #'check.fun-with-values-test/f-args + #'check.fun-with-values-test/f-no-args-value + #'check.fun-with-values-test/f-no-args #'check.fun-with-values-test/private-f #'check.fun-with-values-test/f-value) (f) @@ -41,6 +48,8 @@ (is (= with-fun 42)) (is (= (with-partial 1) 42)) (is (= (f-in-f 1) 42)) + (is (= f-no-args-value 42)) + (is (= (f-no-args) 42)) (is (= (f-args 41 1) 42)) (is (= (private-f 1) 42)) (is (= f-value 42)))