Created
February 1, 2019 08:43
-
-
Save vishnuvp/870c1e3d921274a3e9fe9a25efaaadf7 to your computer and use it in GitHub Desktop.
Clojure is homoiconic
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
user=> (+ 1 1) | |
2 | |
user=> (defn to-word [symbol] | |
#_=> (case symbol | |
#_=> + `plus | |
#_=> 1 `one | |
#_=> 2 `two | |
#_=> 3 `three | |
#_=> 4 `four | |
#_=> 5 `five | |
#_=> 6 `six | |
#_=> 7 `seven | |
#_=> 8 `eight | |
#_=> 9 `nine | |
#_=> 0 `zero | |
#_=> )) | |
#'user/to-word | |
user=> (to-word 1) | |
user/one | |
user=> (quote (+ 1 1)) | |
(+ 1 1) | |
user=> (map to-word (quote (+ 1 2))) | |
(user/plus user/one user/two) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment