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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!news.glorb.com!news2.glorb.com!wn11feed!worldnet.att.net!bgtnsc05-news.ops.worldnet.att.net.POSTED!53ab2750!not-for-mail Newsgroups: comp.lang.ada From: anon@anon.org (anon) Subject: Re: unsigned type Reply-To: anon@anon.org (anon) References: <59O1m.404661$4m1.69194@bgtnsc05-news.ops.worldnet.att.net> <19faf5c6-1cce-4958-a308-bac61b6ff0eb@r10g2000yqa.googlegroups.com> X-Newsreader: IBM NewsReader/2 2.0 Message-ID: Date: Mon, 29 Jun 2009 19:26:07 GMT NNTP-Posting-Host: 12.65.6.97 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc05-news.ops.worldnet.att.net 1246303567 12.65.6.97 (Mon, 29 Jun 2009 19:26:07 GMT) NNTP-Posting-Date: Mon, 29 Jun 2009 19:26:07 GMT Organization: AT&T Worldnet Xref: g2news2.google.com comp.lang.ada:6724 Date: 2009-06-29T19:26:07+00:00 List-Id: Using Range attribute indexes the entire String or Array and sometime an algorithm may need sub-sets. Like instead of spanning an 1K array the algorithm, needs on 9 cells. And the 1..10 example you use states that your index is all Natural what if you use the "type Color is ( Blue, Green, Red, ... ) ;". 1..10 would cause a compiler error. Type is also important. But the compiler will assign a scalar values for any enumeration type. And standards suggest that the scalar value for the enumeration type begins with zero. Without standards, computer do not work! In <19faf5c6-1cce-4958-a308-bac61b6ff0eb@r10g2000yqa.googlegroups.com>, Martin writes: >On Jun 29, 9:54=A0am, "Dmitry A. Kazakov" >wrote: >> On Mon, 29 Jun 2009 01:42:31 -0700 (PDT), Martin wrote: >> > On Jun 29, 12:08=A0am, a...@anon.org (anon) wrote: >> >> And as for Natural, well, that is the definition of a String's index a= >nd in most >> >> cases you use Naturals in "for loop' statements. >> >> > Why would you do that? >> >> > If you iterating over an array object (e.g. a String), you should use >> > 'Range, e.g. >> >> > =A0 =A0for I in My_Array'Range loop >> > =A0 =A0 =A0 -- whatever >> > =A0 =A0end loop; >> >> Exactly. However there are cases like copying element of one array into >> another, when you have to specify the index type explicitly. I always >> wished an attribute Index, which for arrays would yield the index subtype >> of the array: >> >> =A0 =A0Index : A'Index; >> >> Another issue is shifted views of arrays. E.g. when you get two arrays A >> and B, you could bring them to a coherent index range. > >True but that hardly fits the billing of "most cases" cited by >'anon'... > >Cheers >-- Martin