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

  1. Newsgroups: comp.lang.ada
  2. Path: sparky!uunet!math.fu-berlin.de!news.belwue.de!news.uni-stuttgart.de!ucaa2385
  3. From: ucaa2385@iris3.csv.ica.uni-stuttgart.de (Peter Hermann)
  4. Subject: Re: Enum's start at 0?
  5. Message-ID: <1993Jan7.152539.11664@news.uni-stuttgart.de>
  6. Sender: news@news.uni-stuttgart.de (USENET News System)
  7. Organization: ica2
  8. References: <1992Dec30.033842.10112@seas.gwu.edu> <1993Jan5.220007.26218@gvl.unisys.com> <1993Jan6.025929.18871@seas.gwu.edu>
  9. Date: Thu, 7 Jan 1993 15:25:39 GMT
  10. Lines: 113
  11.  
  12. In article <1993Jan6.025929.18871@seas.gwu.edu> mfeldman@seas.gwu.edu (Michael Feldman) writes:
  13. >In article <1993Jan5.220007.26218@gvl.unisys.com> schrey@prc.unisys.com writes:
  14. >>In article <1992Dec30.033842.10112@seas.gwu.edu>, mfeldman@seas.gwu.edu (Michael Feldman) writes:
  15. >
  16. >[stuff deleted]
  17. >
  18. >>|> >
  19. >>|> Just like everything else in computing. ASCII characters, for example,
  20. >>|> run from 0 to 127, not 128. You can represent 0..127 using one less bit than
  21. >>|> 1..128.
  22. >>|> 
  23. >>   All right... then why do string indices start at 1? :-)
  24. >>
  25. >Beats me. Anyone out there have an authoritative answer?
  26. >
  27. >Mike Feldman
  28.  
  29. shouldn't beat you. Both are reasonable.
  30.  
  31. The first is considered and used more as an "offset".
  32. Additionally it coincides well with age-old integer-to-byte
  33. and vice versa representation.
  34. This representation can well be adopted and is the most likely
  35. fitting data format when talking to foreign hardware
  36. (in the serendipiduous sense). Additionally, the compiler has 
  37. the minimum conceivable work.
  38. I see no harm with that rule. I see the benefits.
  39.  
  40. The second is naturally used for indexing,
  41. which would be extremely disadvantages with a 0 as first index,
  42. when working on vector and matrix material,
  43. especially for more-dimensional matrices.
  44. Here, you do not think in offsets but in elements, e11,e12,e13,...
  45.  
  46. Peter Hermann
  47.  
  48.  
  49. Newsgroups: comp.lang.ada
  50. Subject: Re: Enum's start at 0?
  51. Summary: 
  52. Expires: 
  53. References: <1992Dec30.033842.10112@seas.gwu.edu> <1993Jan5.220007.26218@gvl.unisys.com> <1993Jan6.025929.18871@seas.gwu.edu>
  54. Sender: 
  55. Followup-To: 
  56. Distribution: 
  57. Organization: ica2
  58. Keywords: 
  59.  
  60. In article <1993Jan6.025929.18871@seas.gwu.edu> mfeldman@seas.gwu.edu (Michael Feldman) writes:
  61. >In article <1993Jan5.220007.26218@gvl.unisys.com> schrey@prc.unisys.com writes:
  62. >>In article <1992Dec30.033842.10112@seas.gwu.edu>, mfeldman@seas.gwu.edu (Michael Feldman) writes:
  63. >
  64. >[stuff deleted]
  65. >
  66. >>|> >
  67. >>|> Just like everything else in computing. ASCII characters, for example,
  68. >>|> run from 0 to 127, not 128. You can represent 0..127 using one less bit than
  69. >>|> 1..128.
  70. >>|> 
  71. >>   All right... then why do string indices start at 1? :-)
  72. >>
  73. >Beats me. Anyone out there have an authoritative answer?
  74. >
  75. >Mike Feldman
  76.  
  77. Newsgroups: comp.lang.ada
  78. Subject: Re: Enum's start at 0?
  79. Summary: 
  80. Expires: 
  81. References: <1992Dec30.033842.10112@seas.gwu.edu> <1993Jan5.220007.26218@gvl.unisys.com> <1993Jan6.025929.18871@seas.gwu.edu>
  82. Sender: 
  83. Followup-To: 
  84. Distribution: 
  85. Organization: ica2
  86. Keywords: 
  87.  
  88. In article <1993Jan6.025929.18871@seas.gwu.edu> mfeldman@seas.gwu.edu (Michael Feldman) writes:
  89. >In article <1993Jan5.220007.26218@gvl.unisys.com> schrey@prc.unisys.com writes:
  90. >>In article <1992Dec30.033842.10112@seas.gwu.edu>, mfeldman@seas.gwu.edu (Michael Feldman) writes:
  91. >
  92. >[stuff deleted]
  93. >
  94. >>|> >
  95. >>|> Just like everything else in computing. ASCII characters, for example,
  96. >>|> run from 0 to 127, not 128. You can represent 0..127 using one less bit than
  97. >>|> 1..128.
  98. >>|> 
  99. >>   All right... then why do string indices start at 1? :-)
  100. >>
  101. >Beats me. Anyone out there have an authoritative answer?
  102. >
  103. >Mike Feldman
  104.  
  105. shouldn't beat you. Both are reasonable.
  106.  
  107. The first is considered and used more as an "offset".
  108. Additionally it coincides well with age-old integer-to-byte
  109. and vice versa representation.
  110. This representation can well be adopted and is the most likely
  111. fitting data format when talking to foreign hardware
  112. (in the serendipiduous sense). Additionally, the compiler has 
  113. the minimum conceivable work.
  114. I see no harm with that rule. I see the benefits.
  115.  
  116. The second is naturally used for indexing,
  117. which would be extremely disadvantages with a 0 as first index,
  118. when working on vector and matrix material,
  119. especially for more-dimensional matrices.
  120. Here, you do not think in offsets but in elements, e11,e12,e13,...
  121.  
  122. Peter Hermann
  123.  
  124.  
  125.