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!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!cyclone1.gnilink.net!gnilink.net!nx01.iad.newshosting.com!newshosting.com!198.186.194.249.MISMATCH!news-out.readnews.com!transit3.readnews.com!panix!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Pascal ranges Date: Tue, 30 Dec 2008 18:19:37 -0500 Organization: The World Public Access UNIX, Brookline, MA 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> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1230679178 16605 192.74.137.71 (30 Dec 2008 23:19:38 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Tue, 30 Dec 2008 23:19:38 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:ZUkSH88uEfSgf9u1ozvEJltvlAg= Xref: g2news1.google.com comp.lang.ada:3144 Date: 2008-12-30T18:19:37-05:00 List-Id: "(see below)" writes: > Often, yes, it is, but there are cases where one wants to model in Pascal a > similar kind of relationship as exists between Integer, Natural and > Positive, but for a more restricted range. I agree. >.. 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; - Bob