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: Thu, 7 Apr 2016 11:56:59 +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-1195184198-1460021341=:30993" X-Trace: pinkpiglet.scc.uni-weimar.de 1460023021 19773 141.54.178.228 (7 Apr 2016 09:57:01 GMT) X-Complaints-To: news@pinkpiglet.scc.uni-weimar.de NNTP-Posting-Date: Thu, 7 Apr 2016 09:57:01 +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:30037 Date: 2016-04-07T11:56:59+02:00 List-Id: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1195184198-1460021341=:30993 Content-Type: text/plain; CHARSET=ISO-8859-15; FORMAT=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Content-ID: On Wed, 6 Apr 2016, Randy Brukardt wrote: > wrote in message > news:alpine.DEB.2.20.1604062240350.29458@debian... > On Wed, 6 Apr 2016, ahlan@marriott.org wrote: >> procedure X(Formal: T) is raise; >> >> and >> >> function Y return T is raise; >> >> where "is raise" stands for "raise Program_Error". That may sometimes co= me >> handy in the context of inheritance, or so. > > (1) The above null procedure X does not and would never raise Program_Err= or, > so the first part of this doesn't make any sense. The OP suggested change the semantic and raise Programm_Error for the=20 above null procedure. I just suggested a possible syntax if you really=20 want to indicate "this is not yet implemented and will raise an exception= =20 if you dare calling it." On the other hand, the existing Ada 2012 syntax will *almost* serve that=20 purpose. =09procedure X(Formal: out T) is null with pre =3D> False; =09-- Procedure X will be implemented in a forthcoming update. =09-- Until then, don't even think of calling it! Alas, this seems only to work if T is tagged and the aspect is=20 "pre'class", rather than plain "pre". > (2) The latter can be written in current Ada 2012: (that is, with TC1 > implemented) > function Y return T is (raise Program_Error); Great! I wasn't aware of that. I always thought, the expression in=20 brackets had to be of type T. Stefan -------- 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-1195184198-1460021341=:30993--