home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / ada / 3895 < prev    next >
Encoding:
Text File  |  1993-01-06  |  1.3 KB  |  34 lines

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