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.1 required=5.0 tests=BAYES_00, PP_MIME_FAKE_ASCII_TEXT autolearn=no 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!gandalf.srv.welterde.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Uninitialized out parameters. Date: Wed, 6 Apr 2016 16:03:34 -0500 Organization: JSA Research & Innovation Message-ID: References: <3be79ab3-ebc7-4169-9713-d50349662403@googlegroups.com> NNTP-Posting-Host: rrsoftware.com X-Trace: loke.gir.dk 1459976615 1018 24.196.82.226 (6 Apr 2016 21:03:35 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Wed, 6 Apr 2016 21:03:35 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-RFC2646: Format=Flowed; Original Xref: news.eternal-september.org comp.lang.ada:30022 Date: 2016-04-06T16:03:34-05:00 List-Id: wrote in message news:alpine.DEB.2.20.1604062240350.29458@debian... On Wed, 6 Apr 2016, ahlan@marriott.org wrote: > In the annotated RM, in the section concerning Null Procedures, it says > "There are no null functions because the return value has to be > constructed somehow; a function that always raises Program_Error doesn't > seem very useful or worth the complication" If there are no null > functions because a return value has to be constructed then surely the > same applies to null procedures that have out parameters. These too > should be prohibited [...] This seems to be right. It does not make much sense to allow the declaration of procedure X(Formal: out T) is null; while prohibiting the declaration of function Y return R is null; The point is, you can neither call X nor Y. Semantically, both statements X(Actual); Actual := Y; are equally useless, or at least their effect is equally undefined. Allowing the declaration of X, but prohibiting the declaration of Y is inconsistent. If people really think they need to declare something like the above procedure X, a revised Ada standard could allow declarations such as procedure X(Formal: T) is raise; and function Y return T is raise; where "is raise" stands for "raise Program_Error". That may sometimes come 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-lucks ----Stefan.Lucks (at) uni-weimar.de, Bauhaus-Universität Weimar, Germany----