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,da3af210412d89fd X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!news.glorb.com!feed.xsnews.nl!border-1.ams.xsnews.nl!border1.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!newsfeed101.telia.com!nf02.dk.telia.net!newsfeed.bahnhof.se!194.100.2.58.MISMATCH!newsfeed1.fi.sn.net!fi.sn.net!newsfeed2.fi.sn.net!news.song.fi!not-for-mail Date: Sun, 21 Oct 2007 23:23:19 +0300 From: Niklas Holsti User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20060628 Debian/1.7.8-1sarge7.1 X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Range types References: <1192994157.867598@athprx04> In-Reply-To: <1192994157.867598@athprx04> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <471bb318$0$27835$39db0f71@news.song.fi> Organization: TDC Song Internet Services NNTP-Posting-Host: laku61.adsl.netsonic.fi X-Trace: 1192997656 news.song.fi 27835 81.17.205.61:32922 X-Complaints-To: abuse@song.fi X-Original-Bytes: 1921 Xref: g2news2.google.com comp.lang.ada:2529 Date: 2007-10-21T23:23:19+03:00 List-Id: Christos Chryssochoidis wrote: > Hi, > > I have a question regarding the range types in Ada. Is there any way to > specify that a type is, say, the values 1..100 and additionally the > values 150..200? Brief answer: sorry, no. You cannot leave gaps in the range of numeric types. You could define an enumeration type with 151 literals and write a "representation clause" for this type that would force the compiler to use the values 1 .. 100 as the internal representation of the first 100 literals and the values 150 .. 200 as the internal representation of the last 51 literals. This would override the the default internal representation that uses the values 0 .. 150 in order. But you could not do direct arithmetic (plus, minus, ...) on such a type because those operations are not predefined for enumeration types. Perhaps you could explain why you need a type with a gap? -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .