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: a07f3367d7,5a88548f1bcf3510 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,UTF8 Received: by 10.181.13.75 with SMTP id ew11mr1117840wid.0.1353058068601; Fri, 16 Nov 2012 01:27:48 -0800 (PST) Path: q13ni312968wii.0!nntp.google.com!feeder2.cambriumusenet.nl!feeder1.cambriumusenet.nl!feed.tweaknews.nl!85.12.40.130.MISMATCH!xlned.com!feeder1.xlned.com!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!border2.nntp.ams2.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!border2.nntp.dca.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!novia!news-hub.siol.net!news1.t-com.hr!newsfeed.CARNet.hr!aioe.org!.POSTED!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Re: Overring function and its returned type Date: Sat, 10 Nov 2012 03:35:17 +0100 Organization: Ada @ Home Message-ID: References: <97a6946f-a707-4dd3-872b-9e851fcf9462@googlegroups.com> NNTP-Posting-Host: aWaWeUaBdaj2Zzc04J1v5A.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/12.02 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable Date: 2012-11-10T03:35:17+01:00 List-Id: Le Sat, 10 Nov 2012 01:28:54 +0100, Yannick Duch=C3=AAne (Hibou57) = a =C3=A9crit: > What's nice with the second attempt, is that it works It works, but it's unsafe on the long=E2=80=91run: if there are, one of = the = preconditions of the inherited `F` must be reported to the other `F`, an= d = the same with postconditions, except you have to report them all. This i= s = too risky, as something may be forgotten and the language does not help = = here. Even more risky if maintenance occurs on the inherited `F` in an = ancestors type, and some predicates are changed, or worst predicates add= ed = while there were none. Even if annoying, the only safe way is really the initial one, that is t= o = just have one `F`, the inherited one overrided, with an added = postcondition and an explicit checked type conversion at call places = (which may be removed in the future if ever a day Ada starts to supports= = this). -- = =E2=80=9CSyntactic sugar causes cancer of the semi-colons.=E2=80=9D [1] =E2=80=9CStructured Programming supports the law of the excluded muddle.= =E2=80=9D [1] [1]: Epigrams on Programming =E2=80=94 Alan J. =E2=80=94 P. Yale Univers= ity