home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.ada
- Path: sparky!uunet!wupost!micro-heart-of-gold.mit.edu!uw-beaver!pattis
- From: pattis@cs.washington.edu (Richard Pattis)
- Subject: Re: STRING starts at 1: why?
- Message-ID: <1993Jan6.075702.21522@beaver.cs.washington.edu>
- Sender: news@beaver.cs.washington.edu (USENET News System)
- Organization: Computer Science & Engineering, U. of Washington, Seattle
- References: <1992Dec30.033842.10112@seas.gwu.edu> <1993Jan5.220007.26218@gvl.unisys.com> <1993Jan6.025929.18871@seas.gwu.edu>
- Date: Wed, 6 Jan 93 07:57:02 GMT
- Lines: 22
-
- I actually once had a list of reasons to start arrays at 0 vs 1, which I've
- conveniently lost. In the spirit of starting a new one, I'll try to recall what
- I can from the old list. An array that is a STRING probably has other special
- properties.
-
-
- Start at 1:
- 'LENGTH is same as 'LAST
- Negated indexes are unique (I used this fact once in a program)
-
- Start at 0:
- Mod works better (for hashing)
- Convient when doing work with 'polynomial-like' things
-
-
- Rich
-
- --
- ------------------------------------------------------------------------------
- Richard E. Pattis "Programming languages are like
- Department of Computer Science pizzas - they come in only "too"
- and Engineering sizes: too big and too small."
-