How to convert lazy sequence to non-lazy in Clojure

doall is all you need. Just because the seq has type LazySeq doesn’t mean it has pending evaluation. Lazy seqs cache their results, so all you need to do is walk the lazy seq once (as doall does) in order to force it all, and thus render it non-lazy. seq does not force the entire collection to be evaluated.

Leave a Comment