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!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: limited agregate and limited components default initialization Date: Tue, 3 Apr 2018 22:12:24 +0200 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <3a9d9cbf-87aa-41a4-89b5-b4a02ebcb748@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 3 Apr 2018 20:12:25 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="6294fd639b54ae015ad3af8cd51aef87"; logging-data="20200"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/U7unX1XwKAwXli1xsA9jBokR3ITxZpWI=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 In-Reply-To: Content-Language: en-US Cancel-Lock: sha1:FWLb6JibDrGfDPtZfphNsMOVDk8= Xref: reader02.eternal-september.org comp.lang.ada:51324 Date: 2018-04-03T22:12:24+02:00 List-Id: On 04/03/2018 09:25 PM, Jean-Claude Rostaing wrote: > Your exemple is simpler, yes, but it allows declaration of unitialized objects. In the specific example which you presented, my version did not allow declaring uninitialized objects, since all initialization was based on the discriminant, and the client had to supply a discriminant. In more complex cases it may be necessary to take other steps to ensure that initialization occurs. Unknown discriminants and a New_Thing function are one way to do that. -- Jeff Carter "[A] brilliant military career that after thirty years catapulted him to the rank of corporal." Take the Money and Run 138