Skip to content

Instantly share code, notes, and snippets.

@michalmarczyk
Created May 1, 2010 10:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michalmarczyk/386218 to your computer and use it in GitHub Desktop.
Save michalmarczyk/386218 to your computer and use it in GitHub Desktop.
(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