ints(), longs(), doubles() <was> Re: Ranges

Brian Goetz brian.goetz at
Fri May 3 09:20:06 PDT 2013

There are two situations that give rise to ranges: math problems (which 
generally want closed ranges) and indexing (which generally wants open 
ranges.)  And its hard to satisfy both with one method.

One question is: should they be spelled the same way?  Would 
indexes(start, bound) and range(start, end) be better than having 
range(start, bound) and rangeClosed(start, end) ?

On 5/3/2013 12:06 PM, Tim Peierls wrote:
> On Fri, May 3, 2013 at 10:53 AM, Paul Sandoz <paul.sandoz at
> <mailto:paul.sandoz at>> wrote:
>     On May 3, 2013, at 3:00 PM, Tim Peierls <tim at
>     <mailto:tim at>> wrote:
>>     I've missed something. How will the user see a difference between
>>     ints() implemented as a closed range vs. a half-open range?
>     The closed range will be for all non-negative int values, where as
>     the half open will be for all non-negative int values except
>     Integer.MAX_VALUE.
> If you were originally asking whether ints() should include MAX_VALUE,
> then my answer is yes. *How* its implementation accomplishes this isn't
> that important to me, whether as rangeClosed(0, Integer.MAX_VALUE) or
> something else.
> --tim

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