comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: Streams and abnormality
Date: Tue, 12 Jun 2012 11:06:48 -0700 (PDT)
Date: 2012-06-12T11:06:48-07:00	[thread overview]
Message-ID: <b05bd568-3d76-4816-ad25-95bb8175b802@googlegroups.com> (raw)
In-Reply-To: <m2pq94jv1r.fsf@pushface.org>

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.  Anyway, your thinking that maybe they meant that it applies only to discriminants with default expressions, doesn't make sense; it has to apply to all discriminants, because the discriminant could be used to control a variant part, and reading a discriminant with an invalid value is going to wreak havoc regardless of whether it has a default expression.

                         -- Adam


> It looks to me as though this should have read
> "discriminants whose component_declaration has a default_expression"
> (see !summary 7).



  reply	other threads:[~2012-06-14 16:42 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 [this message]
2012-06-12 19:49       ` Simon Wright
2012-06-21 18:29       ` Randy Brukardt
replies disabled

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