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,d679dd7e9c16805a X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news.glorb.com!news2!feeder.erje.net!newsfeed0.kamp.net!newsfeed.kamp.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "(see below)" Newsgroups: comp.lang.ada Subject: Re: Pascal ranges Date: Tue, 30 Dec 2008 23:34:11 +0000 Message-ID: References: <7a6baa71-80e8-4f3a-80b6-34935bda2fc0@r10g2000prf.googlegroups.com> <495a0802$0$32677$9b4e6d93@newsspool2.arcor-online.net> <495a2c0a$0$30237$9b4e6d93@newsspool1.arcor-online.net> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Trace: individual.net gEch36lyH6xwIc/nrB/j+QzGtk/AZk37LmKZkO4vECjYFv8BEB Cancel-Lock: sha1:HNUFmYPW7tI6BBtkC03h+tEfMUs= User-Agent: Microsoft-Entourage/12.14.0.081024 Thread-Topic: Pascal ranges Thread-Index: Aclq1x324Q/zP1LrNkWAnGlP0YH2zA== Xref: g2news1.google.com comp.lang.ada:3146 Date: 2008-12-30T23:34:11+00:00 List-Id: On 30/12/2008 23:19, in article wccmyed1cae.fsf@shell01.TheWorld.com, "Robert A Duff" wrote: >> .. The need for these closely >> related subranges is rather smaller in Ada, e.g. thanks to array attributes >> such as 'First and 'Last. > > I don't understand why you say "need...rather smaller" here. > I often have two subtypes of the same type, one for counting > how many there are (0..N), and one for indexing into an array > of them (1..N). Like this: > > type Blah_Index is range 1..N; > subtype Blah_Count is Blah_Index'Base range 0..Blah_Index'Last; Because we could write: type Blah_Count is range 0..N; ... array(Blah_Count range 1..Blah_Count'Last) of ... -- Bill Findlay chez blueyonder.co.uk