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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,df055ffdd469757d X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.68.242.193 with SMTP id ws1mr737164pbc.0.1361020434558; Sat, 16 Feb 2013 05:13:54 -0800 (PST) X-Received: by 10.50.53.232 with SMTP id e8mr519012igp.14.1361020434331; Sat, 16 Feb 2013 05:13:54 -0800 (PST) Path: ov8ni9pbb.1!nntp.google.com!su1no6734973pbb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 16 Feb 2013 05:13:53 -0800 (PST) In-Reply-To: <16s3mt7cm3n61$.8qu6fp1nglfq.dlg@40tude.net> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=114.163.213.55; posting-account=Mi71UQoAAACnFhXo1NVxPlurinchtkIj NNTP-Posting-Host: 114.163.213.55 References: <30edd381-7505-496a-99e5-f884faf33c33@googlegroups.com> <16s3mt7cm3n61$.8qu6fp1nglfq.dlg@40tude.net> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Class wide preconditions: error in GNAT implementation? From: ytomino Cc: mailbox@dmitry-kazakov.de Injection-Date: Sat, 16 Feb 2013 13:13:54 +0000 Content-Type: text/plain; charset=ISO-8859-1 Date: 2013-02-16T05:13:53-08:00 List-Id: We are already inured to polymorphism. So this fact counters to our intuition. I had been confused when I knew it. After all, I took a Eiffel book out. On Saturday, February 16, 2013 6:28:10 PM UTC+9, Dmitry A. Kazakov wrote: > On Fri, 15 Feb 2013 18:50:36 -0800 (PST), ytomino wrote: > > No. It's related to correctness. > Not when checked dynamically by the same program. > > Precondition is a promise for caller, not callee. > Actually it is imposed on both. No. Precondition is imposed on only caller. > > In this case, the caller should keep As.foo'Pre'Class because calling As.foo. > No, the caller shall satisfy the precondition of the callee. Regarding > inheritance, a primitive operation (callee) may weaken the precondition it > overrides. This is why logical disjunction apply, as Randy said. No. The caller is "client" of not Bs but As, in this case. > Considering individual terms of the disjunction, the caller is allowed to > satisfy at least one of them to make the call valid. Imagine, the system is running correctly, but depending on weak precondition of the subclass. On day, new subclass is introduced into this system. This new subclass has strong precondition equally to the superclass. But, existing callers is depending on weak one. It's a bug of callers, not subclasses. "Client" code of superclass should have been fully keeping precondition of superclass all along. In "Design by Contact", the caller of superclass has a contract with only superclass. Randy wrote "to allow analysis without knowing the actual tag". This word is applied to not only analyzer machine but also human programmers. > Note that if the callee were a class-wide operation then its precondition > would read literally. Of course. If you had time, please read the discussion in http://d.puremagic.com/issues/show_bug.cgi?id=6857 . Maybe it's more easy to understand than my words.