Generators (original) (raw)
Paul Sandoz paul.sandoz at oracle.com
Fri Jan 4 05:44:52 PST 2013
- Previous message: Generators
- Next message: Fwd: Forms for reduce() -- part 2
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Jan 4, 2013, at 2:37 PM, Joe Bowbeer <joe.bowbeer at gmail.com> wrote:
I was assuming an open range:
ints().limit(25) == range(0, 25)
Me too.
But good point regarding MAXVALUE. Because of this, a closed range may be a better idea?
I prefer the correlation with limit. Perhaps we need another method rangeClosed?
It would permit the generation of MAXVALUE, avoiding failures like the following:
range(0, Integer.MAXVALUE + 1); // ?!
Is range(0, 0) spec'd?
Returns an empty stream?
Is range(0, -1) spec'd?
Negative step value of -1 inferred?
Paul.
On Fri, Jan 4, 2013 at 4:59 AM, Paul Sandoz <paul.sandoz at oracle.com> wrote:
On Jan 3, 2013, at 10:00 PM, Brian Goetz <brian.goetz at Oracle.COM> wrote:
To be clear: range and ints() are the only remaining int generators? Ranges: there's a "stepping" version of range too. Should the upper bound of range be open or closed? For the current implementation it is open but means one can never iterate to MAXVALUE. May be stating the obvious here but we also need to support negative ranges and step values. Paul.
- Previous message: Generators
- Next message: Fwd: Forms for reduce() -- part 2
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the lambda-libs-spec-observers mailing list