From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,db88d0444fafe8eb X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Thu, 01 Sep 2005 17:56:22 -0500 From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Surprise in array concatenation References: <1125610942.747981.280770@f14g2000cwb.googlegroups.com> X-Newsreader: Tom's custom newsreader Message-ID: Date: Thu, 01 Sep 2005 17:56:22 -0500 NNTP-Posting-Host: 24.6.102.223 X-Trace: sv3-f1r1JM7dqbyVzfoGha0/3d8b6/RFWddUugn4zkBhum26sSldiq9LZ5mavIow0hEP76Po2NyjO3TCQZZ!zEiSd9aAWCZ2wZlumkbdIaix2nzMO8ZVKkaVUmCPO8X19HuTYEF+zxZj3y6bKCpq7qTburxHMyIY X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news1.google.com comp.lang.ada:4388 Date: 2005-09-01T17:56:22-05:00 List-Id: >I completely agree with the marginal utility of other-than-1 least >array indices. I strongly disagree. While not dirt common, other 'firsts in declarations do occur. -n .. +n comes to mind. If you are going to handle slices, you have to assume 'first /= 1 anyway, so you're not losing much by allowing it in declarations. Using 'first instead of 1 also makes it simple to change between integer and enumeration value indexes. The way Ada.Text_IO.Get_Line (et al) returns Last, which works even if you passed it a slice, has surely prevented many an error as compared to other languages which would likely return a count (since "all arrays start at x") and depend on the programmer to do any arithmetic needed to turn it into an index. And if you started all arrays at 1, you probably wouldn't allow the idiom subtype cards is string(1 .. 80); subtype sequence is range 73 .. 80; ... if card(sequence) = (sequence=>' ') then