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 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!news-1.dfn.de!news.dfn.de!news.uni-weimar.de!medsec1.medien.uni-weimar.de!lucks From: Stefan.Lucks@uni-weimar.de Newsgroups: comp.lang.ada Subject: Re: Uninitialized out parameters. Date: Wed, 6 Apr 2016 22:53:51 +0200 Organization: Bauhaus-Universitaet Weimar Message-ID: References: <3be79ab3-ebc7-4169-9713-d50349662403@googlegroups.com> NNTP-Posting-Host: medsec1.medien.uni-weimar.de Mime-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="8323329-1188503959-1459975792=:29458" X-Trace: pinkpiglet.scc.uni-weimar.de 1459976033 9536 141.54.178.228 (6 Apr 2016 20:53:53 GMT) X-Complaints-To: news@pinkpiglet.scc.uni-weimar.de NNTP-Posting-Date: Wed, 6 Apr 2016 20:53:53 +0000 (UTC) X-X-Sender: lucks@debian In-Reply-To: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) Content-ID: Xref: news.eternal-september.org comp.lang.ada:30018 Date: 2016-04-06T22:53:51+02:00 List-Id: --8323329-1188503959-1459975792=:29458 Content-Type: text/plain; CHARSET=ISO-8859-15; FORMAT=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Content-ID: On Wed, 6 Apr 2016, ahlan@marriott.org wrote: > In the annotated RM, in the section concerning Null Procedures, it says= =20 > "There are no null functions because the return value has to be=20 > constructed somehow; a function that always raises Program_Error doesn't= =20 > seem very useful or worth the complication" If there are no null=20 > functions because a return value has to be constructed then surely the=20 > same applies to null procedures that have out parameters. These too=20 > should be prohibited [...] This seems to be right. It does not make much sense to allow the=20 declaration of =09procedure X(Formal: out T) is null; while prohibiting the declaration of =09function Y return R is null; The point is, you can neither call X nor Y. Semantically, both statements =09X(Actual); =09Actual :=3D Y; are equally useless, or at least their effect is equally undefined.=20 Allowing the declaration of X, but prohibiting the declaration of Y is=20 inconsistent. If people really think they need to declare something like the above=20 procedure X, a revised Ada standard could allow declarations such as =09procedure X(Formal: T) is raise; and =09function Y return T is raise; where "is raise" stands for "raise Program_Error". That may sometimes come= =20 handy in the context of inheritance, or so. -------- I love the taste of Cryptanalysis in the morning! -------= - www.uni-weimar.de/de/medien/professuren/mediensicherheit/people/stefan-luck= s ----Stefan.Lucks (at) uni-weimar.de, Bauhaus-Universit=E4t Weimar, Germany-= --- --8323329-1188503959-1459975792=:29458--