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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,9ed2b1e061ff269d X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!s9g2000yqd.googlegroups.com!not-for-mail From: Gautier write-only Newsgroups: comp.lang.ada Subject: Re: Subtypes boundaries Date: Mon, 14 Jun 2010 14:01:17 -0700 (PDT) Organization: http://groups.google.com Message-ID: <2b13f46b-65f9-450a-bb66-68c6093791c4@s9g2000yqd.googlegroups.com> References: <87nhicFa1kU1@mid.individual.net> <87nijlFa1kU2@mid.individual.net> NNTP-Posting-Host: 206.122.158.4 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1276549277 6012 127.0.0.1 (14 Jun 2010 21:01:17 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 14 Jun 2010 21:01:17 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: s9g2000yqd.googlegroups.com; posting-host=206.122.158.4; posting-account=gRqrnQkAAAAC_02ynnhqGk1VRQlve6ZG User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.70 Safari/533.4,gzip(gfe) Xref: g2news1.google.com comp.lang.ada:11731 Date: 2010-06-14T14:01:17-07:00 List-Id: > type ASTERIX is range -5_000..+10_000; > subtype IDEFIX is ASTERIX range 1..20_000; If it is what is in your text book, then it is a mistake - at least from a didactic perspective... To my surprise, it looks legal Ada. One (old) compiler compiles without a complaint; another one (recent) compiles but issues this warning: obelix.adb:3:38: warning: static value out of range of type "ASTERIX" defined at line 2 obelix.adb:3:38: warning: "Constraint_Error" will be raised at run time And keeps its promise at run-time: Execution terminated by unhandled exception Exception name: CONSTRAINT_ERROR Message: obelix.adb:3 range check failed G.