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!news4.google.com!out04b.usenetserver.com!news.usenetserver.com!in04.usenetserver.com!news.usenetserver.com!nx01.iad01.newshosting.com!newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Wed, 23 Apr 2008 12:42:32 +0200 From: Georg Bauhaus User-Agent: Thunderbird 2.0.0.12 (Macintosh/20080213) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Ada.Strings.Bounded References: <80c6fdca-1a89-4d98-b61d-9a405e57d8e5@s13g2000prd.googlegroups.com> <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> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <480f1298$0$6782$9b4e6d93@newsspool2.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 23 Apr 2008 12:42:33 CEST NNTP-Posting-Host: d509d6ea.newsspool2.arcor-online.net X-Trace: DXC=kA1\lDUm1FJWDmlTRbh@=IA9EHlD;3YcB4Fo<]lROoRA8kFiLnc\616M64>JLh>_cHTX3jMnUOHAcKK;ZO X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:21051 Date: 2008-04-23T12:42:33+02:00 List-Id: Robert A Duff schrieb: >> And so now I have developed a Strong Opinion. This is a travesty. > > I agree it's confusing. But "travesty" is too strong. In practise, > none of this matters much. > > Don't you want to be able to say "(Blah + 1) mod 99" without overflow > (where Blah is of subtype X)? Hmm, less explicit and more lazy programming is attractive to many programmers, so just write expressions of a type that cannot be named, just in case of integers. But how about this: procedure Ex is type E is (A, B, C); X: E; begin X := E'pred(E'succ(C)); end Ex; In this case there is a static constraint error. Is this consistent with anything but the Ada LRM's exception for "integer convenience"? Without of course knowing why the choices were made the way they were made for the LRM, my conclusion is that many programmers still prefer high school ideas about numbers over the theory of computer numbers. Is it really inacceptable to write Larger_Type'(Blah + 1) mod 99; The expression doesn't hide a secret about its value range.