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 Path: g2news2.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!ecngs!feeder2.ecngs.de!feeder.erje.net!newsfeed.straub-nv.de!uucp.gnuu.de!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: unsigned type Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <59O1m.404661$4m1.69194@bgtnsc05-news.ops.worldnet.att.net> <36286c5a-99f0-4ed9-8ef0-11d7af230216@e21g2000yqb.googlegroups.com> <19faf5c6-1cce-4958-a308-bac61b6ff0eb@r10g2000yqa.googlegroups.com> Date: Mon, 29 Jun 2009 14:34:15 +0200 Message-ID: <11df14vb5iebz.1mviq9wby0w4x$.dlg@40tude.net> NNTP-Posting-Date: 29 Jun 2009 14:31:02 CEST NNTP-Posting-Host: 6de20300.newsspool1.arcor-online.net X-Trace: DXC=2\j5koiOM6SE47KDAk81NWic==]BZ:af^4Fo<]lROoRQ^YC2XCjHcbYH1H@Tml5BL\DNcfSJ;bb[UFCTGGVUmh?TLK[5LiR>kgRfM9[Cb_ On Mon, 29 Jun 2009 03:10:31 -0700 (PDT), Martin wrote: > On Jun 29, 9:54�am, "Dmitry A. Kazakov" > wrote: >> On Mon, 29 Jun 2009 01:42:31 -0700 (PDT), Martin wrote: >>> On Jun 29, 12:08�am, a...@anon.org (anon) wrote: >>>> And as for Natural, well, that is the definition of a String's index and 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. >> >>> � �for I in My_Array'Range loop >>> � � � -- whatever >>> � �end 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: >> >> � �Index : 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'... Of course it does not. The rule is strictly opposite to what he says: Never use a built-in type if you cannot prove that it fits the requirements and *will* fit them in any observable future. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de