[Jprogramming] index origin 0

Don Guinn donguinn at gmail.com
Sat Jul 24 23:51:58 HKT 2010


Isn't the floor above the ground floor numbered "1" or "first" in Great
Britain?
On Sat, Jul 24, 2010 at 9:00 AM, Leigh J. Halliwell <leigh at lhalliwell.com>wrote:
> Dear J Forum:
>> Occassionally the zero index-origin trips me up; however, it's one of the
> peculiarities of the language that I accept (like 0%0 = 0, rather than _.)
> in order to use the power of J. I accepted it in APL, and I accept it in
> J.
> Besides, most of the time I replace elements in an array after an "i."
> search, which handles the base consistently. So I think that J developers
> will make better use of their time than to add an option for 0/1 indexing.
>> Moreover, my degree was in pure mathematics. In set theory one begins with
> the empty set as zero, and defines the next integer (n+1) as the union of n
> and {n}. So the integer (n+1) is essentially the set of integers from zero
> to n. In that regard, counting from zero is mathematically pleasing.
>> That said, I'll never be so gung-ho about the custom as to start lists with
> zero, as, for example, in the chapter numbering of Ken Iverson's Concrete
> Math Companion -- although I might be tempted label a Forward or an
> Introduction as Chapter 0). Zero developed in the late middle ages, after
> 'first' was established as the leading item. I still bristle at using the
> adjective 'zeroeth'.
>> Sincerely,
>> Leigh
>> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>


More information about the Programming mailing list

AltStyle によって変換されたページ (->オリジナル) /