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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC 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!.POSTED!not-for-mail From: Georg Bauhaus Newsgroups: comp.lang.ada Subject: Re: Uninitialized out parameters. Date: Thu, 07 Apr 2016 09:52:34 +0200 Organization: A noiseless patient Spider Message-ID: References: <3be79ab3-ebc7-4169-9713-d50349662403@googlegroups.com> Reply-To: nonlegitur@futureapps.de Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 7 Apr 2016 07:49:17 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="9f16b24d16d665dc35db636c17c3e61b"; logging-data="30657"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Z5cAg6udOHVKzNcWphvFamUeZYjE2pyg=" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 In-Reply-To: Cancel-Lock: sha1:/fUW3VUlDOQ+3MJAOsm6G+YKiag= Xref: news.eternal-september.org comp.lang.ada:30034 Date: 2016-04-07T09:52:34+02:00 List-Id: On 06/04/16 22:53, Stefan.Lucks@uni-weimar.de wrote: > 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. Two prominent use cases will suggest this hammer won't fly ;-) if used as a replacement: 1. Testing, or integration builds at various incomplete stages: one couldn't test part B of a program if part A of the program, calling X, always raises before it gets to B. 2. OPENSTEP style programming (a.k.a. Cocoa) as an example, meaning that, conceptually, whenever an object is not (yet) defined (nil), but then receives a message, nothing happens. So, if a procedure does nothing and out comes nothing, then it doesn't do harm either, at least if programmers know what to expect. They fill in the blanks later. I'd rather accept null functions in the set of oddities of Ada than be forced to always have finished everything. Note that raising disallows stubs like procedure X (Formal : out T) is begin pragma Warning ("TODO: compute a value for out Formal!") null; end X; Treating warnings as errors should help with strict rejection rules where the projects demand them.