comp.lang.ada
 help / color / mirror / Atom feed
From: "Bob Klungle" <bklungle@ix.netcom.com>
Subject: Re: Discriminant as default initial value
Date: 1997/03/30
Date: 1997-03-30T14:02:07-08:00	[thread overview]
Message-ID: <01bc3d56$6bf79240$74fd1fcc@p5120.bda> (raw)
In-Reply-To: 333DB640.59EA@sirinet.net


> 
> I'm new to Ada and have scoured the FAQ, RM, and Rationale, but haven't
> found an answer to my question that I understand.
> 
> I want to use a discriminant in a record as both a bound in the index
> constraint of a component declaration and as a default initial value. 
> I'm not sure that this is allowed by the RM.
> 
> The following example, while contrived, exhibits behavior that I
> definitely do not understand.  Using GNAT 3.09 for NT with Max defined
> before the Position Matrix, the component record is initialized as
> expected.  When Max is defined after the Position Matrix within the
> record, Max is initialized to a large value that is not even within the
> subtype's range.  No exception is raised.
> 
> Is this expected behavior?  Is it permissible to use the same
> discriminant as both an index bound and a default initial value?  Should
> the behavior change when the order of declaration within the record
> changes?

Scott, I built your example on GNAT3.08/Linux and it worked OK.
Maybe NT. Have NT version installed but having trouble making it work.

bob




  parent reply	other threads:[~1997-03-30  0:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-03-29  0:00 Discriminant as default initial value Scott Renfro
1997-03-29  0:00 ` Matthew Heaney
1997-03-30  0:00   ` Scott Renfro
1997-03-30  0:00 ` Bob Klungle [this message]
1997-03-30  0:00   ` Robert Dewar
1997-03-31  0:00     ` Bob Klungle
1997-03-31  0:00       ` Robert Dewar
1997-03-31  0:00 ` Jon S Anthony
1997-03-31  0:00   ` Robert Dewar
1997-04-02  0:00   ` Jon S Anthony
  -- strict thread matches above, loose matches on Subject: below --
1997-03-30  0:00 Kees de Lezenne Coulande
1997-03-30  0:00 ` Robert Dewar
1997-04-02  0:00 Kees de Lezenne Coulande
1997-04-02  0:00 ` Robert Dewar
1997-04-07  0:00   ` Keith Thompson
1997-04-02  0:00 ` Scott Renfro
1997-04-02  0:00   ` Robert Dewar
replies disabled

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