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=3.8 required=5.0 tests=BAYES_00,INVALID_MSGID, RATWARE_MS_HASH,RATWARE_OUTLOOK_NONAME autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,da74d35864a7d542 X-Google-Attributes: gid103376,public From: "Bob Klungle" Subject: Re: Discriminant as default initial value Date: 1997/03/30 Message-ID: <01bc3d56$6bf79240$74fd1fcc@p5120.bda>#1/1 X-Deja-AN: 229511278 References: <333DB640.59EA@sirinet.net> Organization: B & D Associates X-NETCOM-Date: Sun Mar 30 2:02:07 PM PST 1997 Newsgroups: comp.lang.ada Date: 1997-03-30T14:02:07-08:00 List-Id: > > 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