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,ea5071f634c2ea8b X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.39.100 with SMTP id o4mr1090919pbk.0.1321997162198; Tue, 22 Nov 2011 13:26:02 -0800 (PST) Path: lh20ni6648pbb.0!nntp.google.com!news1.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nx01.iad01.newshosting.com!newshosting.com!news2.euro.net!feeds.phibee-telecom.net!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!gegeweb.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Generic-Package Elaboration Question / Possible GNAT Bug. Date: Tue, 22 Nov 2011 22:26:02 +0100 Organization: cbb software GmbH Message-ID: <1ecuhb030iugz.4q1hfjx371xa.dlg@40tude.net> References: <7bf9bc32-850a-40c6-9ae2-5254fe220533@f29g2000yqa.googlegroups.com> <4295dc09-43de-4557-a095-fc108359f27f@y42g2000yqh.googlegroups.com> <3snehoqgs8ia$.1nobjem6g6hx6$.dlg@40tude.net> <128rdz2581345$.c4td19l7qp9z$.dlg@40tude.net> <16ipwvpdavifr$.17bxf7if7f6kh$.dlg@40tude.net> <4ecb78b1$0$6643$9b4e6d93@newsspool2.arcor-online.net> <1iofgbqznsviu$.phvidtvxlyj4$.dlg@40tude.net> <4ecbb96e$0$6581$9b4e6d93@newsspool3.arcor-online.net> <4ecbdfdb$0$6629$9b4e6d93@newsspool2.arcor-online.net> <12hfiflyf7pr5$.l3pkpgoid8xt$.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: ARmOcGB+2dBIwZUEYVS5Gg.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news1.google.com comp.lang.ada:19043 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2011-11-22T22:26:02+01:00 List-Id: On Tue, 22 Nov 2011 15:03:52 -0600, Randy Brukardt wrote: > Note that I no longer even try to deal with accessibility checks; I use > 'Unchecked_Access (only). Same with me, but since Ada 2005 I tend to use 'Access again, because it works so much better in Ada 2005. > OTOH, dynamic checks like overflow checks and index checks are not evil, Sure, I meant only dynamic checks of *program correctness*. Overflow or index are not such checks, they are here to enforce defined, contracted behavior. Pre-/post-conditions and accessibility checks pretend [only pretend] to be correctness checks, yielding true if the program is correct. As the result the user expects them not to raise exceptions and is programming the rest correspondingly. That is a wrong idea, which makes programs less safe due to false expectations. It is same as reading file and expecting that End_Error is never raised. I want that exception expectations were contracted and checked statically. If impossible to prove, the program should only be legal if it is *visibly* annotated as potentially raising the corresponding exception. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de