From: Scott Renfro <srenfro@sirinet.net>
Subject: Re: Discriminant as default initial value
Date: 1997/03/30
Date: 1997-03-30T00:00:00+00:00 [thread overview]
Message-ID: <333E6F0F.3E02@sirinet.net> (raw)
In-Reply-To: mheaney-ya023680002903972307160001@news.ni.net
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
next prev 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 [this message]
1997-03-30 0:00 ` Bob Klungle
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