To Stream.slice(fromInclusive, toExclusive) or Stream.slice(toSkip, limit) that is the question

Mike Duigou mike.duigou at
Thu Oct 10 16:54:02 PDT 2013

Hello all;

In the review of the renaming patch for Stream.substream() -> slice() Brian asked me to consider also changing the semantics of the parameters from the current Stream.slice(fromInclusive,toExclusive). The rationale is that we then have only one sense of usage in the parameters for skip/limit/slice. This also makes slice() more obviously equivalent to skip(toSkip).limit(limit). I am inclined to agree with him that using the same semantics for the parameters across the three methods has value.

I will go forward with changing to Stream.slice(toSkip,limit) before Monday assuming there is no outcry.


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