ints(), longs(), doubles() <was> Re: Ranges
Tim Peierls
tim at peierls.net
Fri May 3 10:24:16 PDT 2013
On Fri, May 3, 2013 at 12:20 PM, Brian Goetz <brian.goetz at oracle.com> 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.
--tim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/lambda-libs-spec-experts/attachments/20130503/38ec75a0/attachment.html
More information about the lambda-libs-spec-experts
mailing list