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

Tim Peierls tim at
Fri May 3 10:24:16 PDT 2013

On Fri, May 3, 2013 at 12:20 PM, Brian Goetz <brian.goetz at> wrote:

> 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) ?

I don't think it would. While "indexes" does capture the essence of a
common use of this method, I think of [start, bound) as a range, and would
look it up under that name. range and rangeClosed are very similar
concepts; they should have similar names. The potential for confusion
doesn't seem that significant to me.


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