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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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!news1.google.com!news2.google.com!news.glorb.com!ecngs!feeder.ecngs.de!news.osn.de!diablo2.news.osn.de!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Ada.Strings.Bounded Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH 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> Date: Tue, 22 Apr 2008 21:19:27 +0200 Message-ID: <3mz09tpyuy2x.10k2f07q1nrt9$.dlg@40tude.net> NNTP-Posting-Date: 22 Apr 2008 21:19:29 CEST NNTP-Posting-Host: aa0755b7.newsspool2.arcor-online.net X-Trace: DXC=]jKh5RFSZnBA@P]\DA9EHlD;3YcB4Fo<]lROoRAFl8W>\BH3YB]5dk^TmJI3ADNcfSJ;bb[EIRnRBaCd On Tue, 22 Apr 2008 11:47:05 -0700 (PDT), Eric Hughes wrote: > 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. > > I'm out. Completely out. Everything I've said has been predicated on > the assumption that the set of values of a type is what the > declaration says it is, rather than having values that cannot be > assigned to a variable of that type. In my opinion this means that > assignment and variable definition are broken. I don't even care what > the details are at this point. Well, there are reasons why: 1. Integer types are thought as models for mathematical numbers. The range is a constraint put on the set value. 2. This allows to skip a lot of checks when the implementation type is larger than the range. Otherwise, the compiler would be forced to check each intermediate result in order to raise Constraint_Error. 3. It is rather intuitive, normally one expects to get the right result, independently on the intermediate results. Moreover, the compiler might optimize the code choosing a different computation path, so long the result is mathematically correct. 4. It makes programming less tedious, when values close to the range ends are involved. The only real disadvantage I see, is that the program might get non-portable if programmers actively exploit 4. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de