News for hackers. Stuff that matters.
Re:Learning Clojure: comparing with Java streams by zmmmmm on Sunday November 04, 2018 @09:59PM (#18379550)
Out of curiosity, can anybody comment whether the Clojure versions of these are "lazy" in the sense that if you only take the first element from the result, does the the stream process all the results or just the first? eg:

    (first (map #(extract-name %) justice-league))
Does it map all the elements or only the first? This is actually the key aspect of streams, and more important in many ways than whatever syntax sugar is available to invoke the operations.
Re:Learning Clojure: comparing with Java streams by jimbokun on Sunday November 04, 2018 @10:31PM (#18379680)
In Clojure, all of these are lazy by default.
Re:Learning Clojure: comparing with Java streams by phyrex on Monday November 05, 2018 @11:03AM (#18383359)
Yes, map returns a lazy sequence. Lazy sequences get realized in batches of 32, so calling `first` would realize the 32 first values and then return the first one of that.