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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID 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: mheaney@ni.net (Matthew Heaney) Subject: Re: Discriminant as default initial value Date: 1997/03/29 Message-ID: #1/1 X-Deja-AN: 229398466 References: <333DB640.59EA@sirinet.net> Organization: Estormza Software Newsgroups: comp.lang.ada Date: 1997-03-29T00:00:00+00:00 List-Id: In article <333DB640.59EA@sirinet.net>, Scott Renfro wrote: >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. I'm curious: why are you setting the component Max to the value of the discriminant? Do you ever want to change Max? If not, then why not just read the discriminant directly (and get rid of the Max component)? >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. This seems a bit strange. The location of the components within the record should not make any difference. (Yes, there are some restrictions wrt variant parts, but that doesn't apply here.) Matt -------------------------------------------------------------------- Matthew Heaney Software Development Consultant (818) 985-1271