Skip to content

Instantly share code, notes, and snippets.

@deque-blog
Created January 22, 2017 15:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deque-blog/74d44be820de76de6df9b4189607f5b8 to your computer and use it in GitHub Desktop.
Save deque-blog/74d44be820de76de6df9b4189607f5b8 to your computer and use it in GitHub Desktop.
(defn replace-var
[env x]
(if (string? x) (get env x x) x))
(defn partial-eval
[env e]
(walk/postwalk
(comp optimize-mul optimize-add #(replace-var env %))
e))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment