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!news.eternal-september.org!.POSTED!not-for-mail From: "G.B." Newsgroups: comp.lang.ada Subject: Re: Q: Trouble creating array and discriminated type Date: Mon, 23 Jan 2017 09:02:39 +0100 Organization: A noiseless patient Spider Message-ID: References: <83409c51-59d3-4205-9eeb-5467de09f069@googlegroups.com> <3b436d6a-7704-47cf-8f6f-d974771bea63@googlegroups.com> Reply-To: nonlegitur@notmyhomepage.de Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Mon, 23 Jan 2017 08:00:59 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="cca45ae56a5b242f306a520c85846e6b"; logging-data="11469"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX183DvA+kKFWsCDmk8EyRMyeOmpiqXKPbHk=" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 In-Reply-To: <3b436d6a-7704-47cf-8f6f-d974771bea63@googlegroups.com> Cancel-Lock: sha1:LqBzgcv6kyFJoe9ELzSdS/opSj0= Xref: news.eternal-september.org comp.lang.ada:33125 Date: 2017-01-23T09:02:39+01:00 List-Id: On 21.01.17 18:05, Stephen Leake wrote: >> type Ephemeris_Data (Offset_Maximum, Record_Maximum : Positive) is tagged record > If you add defaults to the discriminants, Ada will let you declare an uninitialized object. Defaults for discriminants of tagged types would not be permitted, only if objects of the type can not have their discriminants changed after creation (tagged limited). The reason is stated in AARM 3.7(9.*) and it seems to say "It's complicated". The paragraph suggest that for some use cases, one can declare a subtype that sets the discriminants to default values. IIUC, these subtypes can then be used in derivations also. -- "HOTDOGS ARE NOT BOOKMARKS" Springfield Elementary teaching staff