home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.ada
- Path: sparky!uunet!math.fu-berlin.de!news.belwue.de!news.uni-stuttgart.de!ucaa2385
- From: ucaa2385@iris3.csv.ica.uni-stuttgart.de (Peter Hermann)
- Subject: Re: Enum's start at 0?
- Message-ID: <1993Jan7.152539.11664@news.uni-stuttgart.de>
- Sender: news@news.uni-stuttgart.de (USENET News System)
- Organization: ica2
- References: <1992Dec30.033842.10112@seas.gwu.edu> <1993Jan5.220007.26218@gvl.unisys.com> <1993Jan6.025929.18871@seas.gwu.edu>
- Date: Thu, 7 Jan 1993 15:25:39 GMT
- Lines: 113
-
- 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:
- References: <1992Dec30.033842.10112@seas.gwu.edu> <1993Jan5.220007.26218@gvl.unisys.com> <1993Jan6.025929.18871@seas.gwu.edu>
- Sender:
- 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:
- References: <1992Dec30.033842.10112@seas.gwu.edu> <1993Jan5.220007.26218@gvl.unisys.com> <1993Jan6.025929.18871@seas.gwu.edu>
- Sender:
- 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
-
-
-