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,7d83a6223f4f2443 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!news.germany.com!npeer.de.kpn-eurorings.net!npeer-ng2.de.kpn-eurorings.net!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Run-time accessibility checks 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: <68719e0e-af31-488a-b45c-f8db93fb70d2@v13g2000yqm.googlegroups.com> Date: Sun, 7 Dec 2008 09:44:13 +0100 Message-ID: NNTP-Posting-Date: 07 Dec 2008 09:44:15 CET NNTP-Posting-Host: 0a1f0cdc.newsspool4.arcor-online.net X-Trace: DXC=BELOQ46]n8o_0Po7BmQ3]l4IUK<3kDNcfSJ;bb[eIRnRBaCdCf:DgigXWf X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:3885 Date: 2008-12-07T09:44:15+01:00 List-Id: On Sat, 6 Dec 2008 09:10:49 -0800 (PST), Ludovic Brenta wrote: > Dmitry A. Kazakov wrote: >> It is absolutely unacceptable to me that a correct >> program might fail at run-time because of accessibility checks. > > I differ here; to me, a program that fails an accessibility check at > run time is incorrect. Ah, I used to think this way too. But then I realized that this form of constraint is not a semantic one. Comparing to the constraint range 1..10, accessibility constraint is an implementation detail. It has no semantic meaning. When you assign a value outside the range that is semantically incorrect. When you assign a pointer that potentially might become dangling, that has no semantic meaning. The pointer is not yet dangling. The program correctness depends on whether it will become dangling. >> The only >> case I could buy it, if exceptions where contracted, so that I would get an >> compile-time error at some other place. Like "Constraint_Error may be >> propagated, but the contract states otherwise." > > In my understanding, there is an implicit contract stating that all > subprograms may raise at least Program_Error, Storage_Error or > Constraint_Error. That must be changed. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de