Skip to content

Instantly share code, notes, and snippets.

@AlexBaranosky
Created December 20, 2011 12:05
Show Gist options
  • Save AlexBaranosky/1501358 to your computer and use it in GitHub Desktop.
Save AlexBaranosky/1501358 to your computer and use it in GitHub Desktop.
steady-state
(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