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
(defmacro lazy | |
"Returns a lazy sequence of calls to (f). Arguments are evaluated once as needed. | |
(lazy f a b c d) --> (a, (f a b), (f (f a b) c), (f (f (f a b) c) d))" | |
([f x] | |
`(lazy-seq | |
(list ~x)) ) | |
([f x form & more] | |
`(lazy-seq | |
(let [x# ~x] | |
(cons x# |