You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Java APIs increasingly return Streams and are hard to consume because they do not implement interfaces that Clojure already supports, and hard to interop with because Clojure doesn't directly implement Java functional interfaces.
In addition to functional interface support, Clojure now provides these functions to interoperate with streams in an idiomatic manner, all functions behave analogously to their Clojure counterparts:
(stream-seq! stream) => seq
(stream-reduce! f [init-val] stream) => val
(stream-transduce! xf f [init-val] stream) => val
(stream-into! to-coll [xf] stream) => to-coll
All of these operations are terminal stream operations (they consume the stream).
From the release notes:
Java APIs increasingly return Streams and are hard to consume because they do not implement interfaces that Clojure already supports, and hard to interop with because Clojure doesn't directly implement Java functional interfaces.
In addition to functional interface support, Clojure now provides these functions to interoperate with streams in an idiomatic manner, all functions behave analogously to their Clojure counterparts:
All of these operations are terminal stream operations (they consume the stream).
See: CLJ-2775
The text was updated successfully, but these errors were encountered: