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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,d3770aac68211766 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Received: by 10.224.207.66 with SMTP id fx2mr6890182qab.7.1352163850608; Mon, 05 Nov 2012 17:04:10 -0800 (PST) Received: by 10.236.127.133 with SMTP id d5mr1039346yhi.1.1352163850587; Mon, 05 Nov 2012 17:04:10 -0800 (PST) Path: gf5ni18188417qab.0!nntp.google.com!c7no8069837qap.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 5 Nov 2012 17:04:10 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=206.53.78.59; posting-account=ShYTIAoAAABytvcS76ZrG9GdaV-nXYKy NNTP-Posting-Host: 206.53.78.59 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <715c26cd-06c2-40c1-8317-eacd228b1ebc@googlegroups.com> Subject: Re: Class wide preconditions: error in the Ada 2012 Rationale? From: sbelmont700@gmail.com Injection-Date: Tue, 06 Nov 2012 01:04:10 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-11-05T17:04:10-08:00 List-Id: On Monday, November 5, 2012 3:41:57 PM UTC-5, Hibou57 (Yannick Duch=EAne) w= rote: >=20 > I believe either my understanding is wrong, or the Rationale is wrong. Th= e =20 >=20 > above statements are not compatible with the substitution principle. What= =20 >=20 > if a sub-program expects a a class wide type with a root type and its =20 >=20 > precondition, and get a derived type with a specific precondition it can'= t =20 >=20 > know about? >=20 A foundation of the LSP is that you should not be strengthening preconditio= ns for derived types. After all, when you substitue a child for a parent, = you cannot know anything about the child, which includes any additional pre= conditions that have been added. If classwide preconditions are checked at= the point of the call, then it might dispatch to subprograms with precondi= tions that haven't even been written yet (that it clearly cannot check befo= rehand). -sb