Re: Inclusive-exclusive range

2009-03-04 Thread Meikel Brandmeyer
Hi, Am 04.03.2009 um 14:06 schrieb Mibu: On Mar 4, 2:46 pm, Michael Wood wrote: On Wed, Mar 4, 2009 at 2:07 PM, Mibu wrote: Why does range in Clojure use an inclusive-exclusive range? For what it's worth, Python's range function works the same way. I think Clojure's desig

Re: Inclusive-exclusive range

2009-03-04 Thread Itay Maman
4, 3:40 pm, Konrad Hinsen wrote: > On Mar 4, 2009, at 14:06, Mibu wrote: > > > On Mar 4, 2:46 pm, Michael Wood wrote: > >> On Wed, Mar 4, 2009 at 2:07 PM, Mibu wrote: > >>> Why does range in Clojure use an inclusive-exclusive range? > >> For what it's

Re: Inclusive-exclusive range

2009-03-04 Thread Michael Wood
On Wed, Mar 4, 2009 at 3:17 PM, Mibu wrote: > > Joshua, my puzzlement is not with the first element but the last. > > For example, the (range -1 2) gives (-1 0 1). Because, if you have a vector of 10 elements, (and your language starts indexing from 0) you can use (range 10) for the indexes, ins

Re: Inclusive-exclusive range

2009-03-04 Thread Konrad Hinsen
On Mar 4, 2009, at 14:06, Mibu wrote: > On Mar 4, 2:46 pm, Michael Wood wrote: >> On Wed, Mar 4, 2009 at 2:07 PM, Mibu wrote: >>> Why does range in Clojure use an inclusive-exclusive range? >> For what it's worth, Python's range function works the same way.

Re: Inclusive-exclusive range

2009-03-04 Thread Mibu
Joshua, my puzzlement is not with the first element but the last. For example, the (range -1 2) gives (-1 0 1). On Mar 4, 3:06 pm, Joshua Fox wrote: > This is discussed, with references, > herehttp://en.wikipedia.org/wiki/Array#Index_of_the_first_element --~--~-~--~~~--

Re: Inclusive-exclusive range

2009-03-04 Thread Mibu
On Mar 4, 2:46 pm, Michael Wood wrote: > On Wed, Mar 4, 2009 at 2:07 PM, Mibu wrote: > > Why does range in Clojure use an inclusive-exclusive range? > For what it's worth, Python's range function works the same way. I think Clojure's design leans towards what'

Re: Inclusive-exclusive range

2009-03-04 Thread Joshua Fox
This is discussed, with references, here http://en.wikipedia.org/wiki/Array#Index_of_the_first_element --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@goog

Re: Inclusive-exclusive range

2009-03-04 Thread Michael Wood
On Wed, Mar 4, 2009 at 2:07 PM, Mibu wrote: > > Why does range in Clojure use an inclusive-exclusive range? > > I'm aware of the traditional substring range convention, which always > puzzled me as to how an unintuitive and error-prone use became > cemented as the norm. &g

Re: Inclusive-exclusive range

2009-03-04 Thread Joshua Fox
t; Why does range in Clojure use an inclusive-exclusive range? > > I'm aware of the traditional substring range convention, which always > puzzled me as to how an unintuitive and error-prone use became > cemented as the norm. > > I'm not calling for a change in

Inclusive-exclusive range

2009-03-04 Thread Mibu
Why does range in Clojure use an inclusive-exclusive range? I'm aware of the traditional substring range convention, which always puzzled me as to how an unintuitive and error-prone use became cemented as the norm. I'm not calling for a change in range. I'm just ge