comp.lang.ada
 help / color / mirror / Atom feed
From: "G.B." <bauhaus@notmyhomepage.invalid>
Subject: Re: Q: Trouble creating array and discriminated type
Date: Mon, 23 Jan 2017 09:02:39 +0100
Date: 2017-01-23T09:02:39+01:00	[thread overview]
Message-ID: <o64d7r$b6d$1@dont-email.me> (raw)
In-Reply-To: <3b436d6a-7704-47cf-8f6f-d974771bea63@googlegroups.com>

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


  parent reply	other threads:[~2017-01-23  8:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-20 22:55 Q: Trouble creating array and discriminated type b.mcguinness747
2017-01-20 23:48 ` gautier_niouzes
2017-01-21  7:23 ` Simon Wright
2017-01-21  9:41 ` Jeffrey R. Carter
2017-01-21 17:05 ` Stephen Leake
2017-01-22  5:12   ` Robert Eachus
2017-01-23  8:02   ` G.B. [this message]
2017-01-23  8:19     ` Simon Wright
2017-01-21 18:55 ` b.mcguinness747
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox