comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Streams and abnormality
Date: Thu, 21 Jun 2012 13:29:35 -0500
Date: 2012-06-21T13:29:35-05:00	[thread overview]
Message-ID: <jrvp6j$k5$1@munin.nbi.dk> (raw)
In-Reply-To: b05bd568-3d76-4816-ad25-95bb8175b802@googlegroups.com

"Adam Beneschan" <adam@irvine.com> wrote in message 
news:b05bd568-3d76-4816-ad25-95bb8175b802@googlegroups.com...
On Tuesday, June 12, 2012 10:32:00 AM UTC-7, Simon Wright wrote:

>> Looking at the AI[2], I must say I don't see quite where the
>> "discriminants or if the component_declaration has a default_expression"
>> comes from.
>
>Well, the wording was there in the first version of Ada 95 (AI95-195 didn't 
>change it).
>!summary 7 has to do with discriminants that don't match when 'Read is 
>called, the
>discriminants have default expressions (otherwise they're not read from the 
>stream),
>and the actual parameter is constrained.  It doesn't address the issue of 
>invalid representations.

>In RM12, the wording will be changed to "for each scalar component that is 
>a discriminant or
>that has an implicit initial value".  But I think this indicates that the 
>wording was deliberate.
>I don't know why it was important to specify this for components with 
>default expressions (or
>implicit initial values), and the Ada 95 Rationale doesn't say.

The idea (I think) is that components with valid initial values can't get 
"deinitialized" by streaming in garbage. But if they're not initialized, 
then its OK for them to have garbage (since they start out that way anyway). 
There is a similar rule for "out" parameters - for Ada 2012, we had to 
include values that are initialized via a "Default_Value" aspect (which is 
why the wording changes).

                                                  Randy.





      parent reply	other threads:[~2012-06-21 18:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-12  9:31 Streams and abnormality Simon Wright
2012-06-12 15:01 ` Adam Beneschan
2012-06-12 17:03   ` Dmitry A. Kazakov
2012-06-12 17:32   ` Simon Wright
2012-06-12 18:06     ` Adam Beneschan
2012-06-12 19:49       ` Simon Wright
2012-06-21 18:29       ` Randy Brukardt [this message]
replies disabled

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