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: Scott Renfro Subject: Re: Discriminant as default initial value Date: 1997/03/30 Message-ID: <333E6F0F.3E02@sirinet.net>#1/1 X-Deja-AN: 229514155 References: <333DB640.59EA@sirinet.net> Organization: Sirius Systems Group, Inc. Newsgroups: comp.lang.ada Date: 1997-03-30T00:00:00+00:00 List-Id: Matthew Heaney wrote: > > 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)? I can, and intend to, use the value of the discriminant as the max rather than the Max component, but stumbled onto this behavior while converting from a non-discriminant version of the same data structure. I had not yet removed the Max component and was surprised when I could not initialize it's value from the discriminant. Yes, I'm on a tangent, but do want to understand this behavior since it surprised me. > 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.) That's what I thought. I just figured my lack of experience was a much more likely root cause of this than a bug in GNAT. Scott