Primitive streams (original) (raw)

Joe Bowbeer joe.bowbeer at gmail.com
Fri Dec 28 18:01:06 PST 2012


ByteStream seems fundamental. Wouldn't it be worthwhile to support this?

On Fri, Dec 28, 2012 at 11:50 AM, Brian Goetz <brian.goetz at oracle.com>wrote:

While many Java programmers are unfamiliar with reduce, there are many

FP-aware folks (ruby, groovy, etc) who will want to transfer their favorite expressions to Java. We shouldn't go out of or way to make this transfer difficult.

No, we're not going to make this difficult. Those already familiar with reduce should be pretty happy. The question is, what should we do to accomodate the other 95% of java developers? Giving them reduce only seems like throwing them in the deep end of the pool. Speaking of favorite expressions, how about char streams? A lot of functional kata are char based. But are there real world examples where lack of CharStream would bite? In any event don't lose IntStream. Currently we expose String.chars() String.codePoints() as IntStream. If you want to deal with them as chars, you can downcast them to chars easily enough. Doesn't seem like an important enough use case to have a whole 'nother set of streams. (Same with Short, Byte, Float). -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/lambda-libs-spec-experts/attachments/20121228/7214d3b8/attachment.html



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