Created
December 20, 2011 12:05
-
-
Save CampingScorpion/1501358 to your computer and use it in GitHub Desktop.
steady-state
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn steady-state | |
([f x] | |
(steady-state f x [])) | |
([f x results] | |
(let [calculated (f x)] | |
(if (= calculated x) | |
results | |
(recur f calculated (conj results calculated)))))) | |
(def macroexpand-scan (partial steady-state macroexpand-1)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment