Last active
January 22, 2017 18:19
-
-
Save deque-blog/8913e42131c74b13d038cb1445af2c04 to your computer and use it in GitHub Desktop.
This file contains 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 optimize-add [e] | |
(if (add? e) | |
(optimize-op e + 0) | |
e)) | |
(defn optimize-mul [e] | |
(if (mul? e) | |
(if (some #{(cst 0)} e) | |
(cst 0) | |
(optimize-op e * 1)) | |
e)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment