Open
Description
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:
(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).
See: CLJ-2775
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
seancorfield commentedon Jan 1, 2025
Official docs to link to https://clojure.org/reference/java_interop#streams (identical to what's in the release notes -- so we need examples!).
seancorfield commentedon Jan 1, 2025
seancorfield commentedon Feb 23, 2025
Unconvincing example with
future
asSupplier
😄