Last active
August 29, 2015 14:01
-
-
Save luisgabriel/2c5564bc99b125aad136 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 is-ascii-alpha-num [c] | |
(let [n (Character/getNumericValue (char c))] | |
(or (and (>= n (char-val \a)) (<= n (char-val \z))) | |
(and (>= n (char-val \A)) (<= n (char-val \Z))) | |
(and (>= n (char-val \0)) (<= n (char-val \9))))) |
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
[:program | |
[:binary-exp | |
:minus | |
[:binary-exp | |
:add | |
[:value [:int 1]] | |
[:value [:int 2]]] | |
[:unary-exp | |
:length | |
[:value [:string "hello"]] | |
] | |
] | |
] |
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 square [x] | |
(* x x)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment