Created
May 15, 2010 21:01
-
-
Save aboekhoff/402394 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
;; pointless ml-style syntax | |
;; (now just need a parser combinator to add incanter's infix math and were in business) | |
(defmacro mlet [& xs] | |
(let [[[n & args] l2] (split-with #(not= '= %) xs) | |
[l2 l3] (split-with #(not= 'in %) l2)] | |
`(let [~n (fn ~n [~@args] ~(rest l2))] ~(rest l3)))) | |
(comment | |
(mlet f x = * x x in | |
mlet g x = + x x in | |
-> 42 g f) | |
=> 7056) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment