From: ucaa2385@iris3.csv.ica.uni-stuttgart.de (Peter Hermann)
Subject: Re: Enum's start at 0?
Organization: ica2
Date: Thu, 7 Jan 1993 15:25:39 GMT

In article <1993Jan6.025929.18871@seas.gwu.edu> mfeldman@seas.gwu.edu (Michael Feldman) writes:
>In article <1993Jan5.220007.26218@gvl.unisys.com> schrey@prc.unisys.com writes:
>>In article <1992Dec30.033842.10112@seas.gwu.edu>, mfeldman@seas.gwu.edu (Michael Feldman) writes:
>
>[stuff deleted]
>
>>|> >
>>|> Just like everything else in computing. ASCII characters, for example,
>>|> run from 0 to 127, not 128. You can represent 0..127 using one less bit than
>>|> 1..128.
>>|> 
>>   All right... then why do string indices start at 1? :-)
>>
>Beats me. Anyone out there have an authoritative answer?
>
>Mike Feldman

shouldn't beat you. Both are reasonable.

The first is considered and used more as an "offset".
Additionally it coincides well with age-old integer-to-byte
and vice versa representation.
This representation can well be adopted and is the most likely
fitting data format when talking to foreign hardware
(in the serendipiduous sense). Additionally, the compiler has 
the minimum conceivable work.
I see no harm with that rule. I see the benefits.

The second is naturally used for indexing,
which would be extremely disadvantages with a 0 as first index,
when working on vector and matrix material,
especially for more-dimensional matrices.
Here, you do not think in offsets but in elements, e11,e12,e13,...

Peter Hermann


Newsgroups: comp.lang.ada
Subject: Re: Enum's start at 0?
Summary: 
Expires: 
Followup-To: 
Distribution: 
Organization: ica2
Keywords: 

In article <1993Jan6.025929.18871@seas.gwu.edu> mfeldman@seas.gwu.edu (Michael Feldman) writes:
>In article <1993Jan5.220007.26218@gvl.unisys.com> schrey@prc.unisys.com writes:
>>In article <1992Dec30.033842.10112@seas.gwu.edu>, mfeldman@seas.gwu.edu (Michael Feldman) writes:
>
>[stuff deleted]
>
>>|> >
>>|> Just like everything else in computing. ASCII characters, for example,
>>|> run from 0 to 127, not 128. You can represent 0..127 using one less bit than
>>|> 1..128.
>>|> 
>>   All right... then why do string indices start at 1? :-)
>>
>Beats me. Anyone out there have an authoritative answer?
>
>Mike Feldman

Newsgroups: comp.lang.ada
Subject: Re: Enum's start at 0?
Summary: 
Expires: 
Followup-To: 
Distribution: 
Organization: ica2
Keywords: 

In article <1993Jan6.025929.18871@seas.gwu.edu> mfeldman@seas.gwu.edu (Michael Feldman) writes:
>In article <1993Jan5.220007.26218@gvl.unisys.com> schrey@prc.unisys.com writes:
>>In article <1992Dec30.033842.10112@seas.gwu.edu>, mfeldman@seas.gwu.edu (Michael Feldman) writes:
>
>[stuff deleted]
>
>>|> >
>>|> Just like everything else in computing. ASCII characters, for example,
>>|> run from 0 to 127, not 128. You can represent 0..127 using one less bit than
>>|> 1..128.
>>|> 
>>   All right... then why do string indices start at 1? :-)
>>
>Beats me. Anyone out there have an authoritative answer?
>
>Mike Feldman

shouldn't beat you. Both are reasonable.

The first is considered and used more as an "offset".
Additionally it coincides well with age-old integer-to-byte
and vice versa representation.
This representation can well be adopted and is the most likely
fitting data format when talking to foreign hardware
(in the serendipiduous sense). Additionally, the compiler has 
the minimum conceivable work.
I see no harm with that rule. I see the benefits.

The second is naturally used for indexing,
which would be extremely disadvantages with a 0 as first index,
when working on vector and matrix material,
especially for more-dimensional matrices.
Here, you do not think in offsets but in elements, e11,e12,e13,...

Peter Hermann