Stream, spliterator, supplier and size

Brian Goetz brian.goetz at oracle.com
Fri Dec 14 07:24:12 PST 2012


> I've trouble to understand why we need to expose two semantics to our
> poor users,

But I don't think we've exposed them to the users!  The stream() methods 
are not for users, they are for library writers to implement 
stream-producing methods.  If users are using them then that means we've 
forgotten to provide something else.  (Writing Iterators is a pain the 
neck, much more so.  But again, most users don't write iterators.)

Your other argument about "we should bind to the data earlier" is a 
reasonable thing to discuss from a semantic perspective, but not because 
the API for making streams is too hard.



More information about the lambda-libs-spec-observers mailing list