Skip to content

Instantly share code, notes, and snippets.

@brandonbloom
Last active December 17, 2016 00:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brandonbloom/b8a9ace37b93a6ff369d64e821a6e5ff to your computer and use it in GitHub Desktop.
Save brandonbloom/b8a9ace37b93a6ff369d64e821a6e5ff to your computer and use it in GitHub Desktop.
(def ^:dynamic foo [])
(def ^:dynamic bar)
(defn state []
{#'foo foo, #'bar bar})
(defn helper []
(uses bar)
(defn step1 []
(something foo (helper)))
(defn step2 []
(something-else bar))
(defn result []
(yet-another-thing foo bar))
(defn run [init-bar]
(with-bindings (assoc (state) #'bar init-bar)
(step1)
(step2)
(when debug
(pprint (state)))
(result)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment