Last active
January 22, 2017 17:53
-
-
Save deque-blog/2c224ac4950c2d8a9d32b44aa649227d to your computer and use it in GitHub Desktop.
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 print-expr [expr] | |
(walk/postwalk | |
(fn algebra [e] | |
(cond | |
(cst? e) (str e) | |
(sym? e) e | |
(add? e) (str "(+ " (string/join " " (rest e)) ")") | |
(mul? e) (str "(* " (string/join " " (rest e)) ")") | |
:else e)) | |
expr)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment