Created
May 1, 2010 10:15
-
-
Save michalmarczyk/386218 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
(deftype SuperLazySeq [f r] | |
clojure.lang.ISeq | |
(first [self] (force f)) | |
(next [self] r) | |
clojure.lang.Seqable | |
(seq [self] self)) | |
(defmacro sl-cons [x sls] | |
`(SuperLazySeq. (delay ~x) ~sls)) | |
(defmacro sl-list [& [x & ys :as xs]] | |
(when xs | |
`(sl-cons ~x (sl-list ~@ys)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment