Remove cumulate from Stream interface

Brian Goetz brian.goetz at oracle.com
Wed Dec 5 10:55:44 PST 2012


>> Plus, your Mapper will violate the to-be-written specs about
>> statefulness/side-effects in lambdas passed to functional stream methods.
>
> Do you really want this overly restrictive wording for streams that are
> sequential ?
> I find this unrealistic, even if you try to specify this in the doc,
> nobody read the doc if not forced.
> Given that will not be enforced in the code, it will be only true on the
> paper.

It may be unrealistic, but we have to do it anyway.  If someone passes a 
Function to map() that mutates the collection source, all bets are going 
to be off, and we have to say this.  The spec can characterize when 
things are guaranteed to work; if people do things that accidentally 
work because they are operating in a restrictive environment, that's 
their concern.



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