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,640b65cbfbab7216 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!f36g2000hsa.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Ada.Strings.Bounded Date: Tue, 22 Apr 2008 13:15:24 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <1wh7cbu67y4wz$.7iu8likx0fct.dlg@40tude.net> <144w648u50r6q.1erjxxu0cplbw.dlg@40tude.net> <611360e0-595c-43a7-b5cb-137a278ec0c1@s13g2000prd.googlegroups.com> <15389tuelo6x6$.1c1a6yixordts$.dlg@40tude.net> <4c1be2a2-0178-4c1f-8c96-526020550f42@w4g2000prd.googlegroups.com> <15514187-d7d0-4650-a058-13ec5684be2c@w5g2000prd.googlegroups.com> <07e98c4f-9b79-412f-9e95-94dd04082355@p39g2000prm.googlegroups.com> <3eb5775f-c7f7-4f92-9154-8f25246b8592@p25g2000hsf.googlegroups.com> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1208895325 3923 127.0.0.1 (22 Apr 2008 20:15:25 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 22 Apr 2008 20:15:25 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: f36g2000hsa.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.7.12-1.3.1,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:21045 Date: 2008-04-22T13:15:24-07:00 List-Id: On Apr 22, 11:47 am, Eric Hughes wrote: > So now wait. When I declare > type X is range 0 .. 99 ; > does that mean that the value 100 is a value of type X? Yes. See 3.2.1(6). This declaration defines both a *type* X and its *first subtype* X. The type X includes all integers. The subtype X imposes a constraint of 0..99 on that type. When you declare Var : X; and then assign something into Var, the expression's value will be checked against the subrange 0..99, just as if you had said type Y is range 0..1_000_000_000; subtype YY is Y range 0..99; Var : YY; > And so now I have developed a Strong Opinion. This is a travesty. A > probably-irredeemable travesty. This is so completely counter- > intuitive that I have a hard time believing that competent people came > up with this way of writing the definition. It's unnecessary. There > are far better ways of defining this, and they don't break any > existing syntax. Back on April 15, in a different thread, you said "Make the formal standard normative, the human language expository", arguing that it would be OK for the formal standard to be inaccessible to human programmers. Now, in a case where the formal standard has been made a little bit complex in order to get the language to work they way they wanted it to work, then you complain about it not being intuitive. I don't think you can have it both ways. But I am going to complain bitterly about one thing: you are way out of line to insinuate that the people who came up with the standard are incompetent. WAY out of line. I know how much work the people who work on the standard put into it, and how much thought they put into making sure everything fits together and all the bases are covered while at the same time trying to make it reasonably readable. So even if you don't understand why the standard's authors defined something the way they did, you can assume there's a 99.9999% chance that there was a darn good reason why they did it that way. In this particular case, I think they saw a need to support static expressions with intermediate results that were larger than a machine integer, and the type/subtype definitions they came up with allowed them to accomplish this. -- Adam