comp.lang.ada
 help / color / mirror / Atom feed
From: DrPi <314@drpi.fr>
Subject: Re: Question on variant/discriminated records
Date: Thu, 31 Dec 2020 14:29:27 +0100	[thread overview]
Message-ID: <5fedd239$0$21616$426a74cc@news.free.fr> (raw)
In-Reply-To: <ba97a48d-6e75-49e8-8a62-a5dea3c6189cn@googlegroups.com>

Le 31/12/2020 à 13:46, Gautier write-only address a écrit :
> On Thursday, December 31, 2020 at 1:24:25 PM UTC+1, reinert wrote:
>> Here must be a hole in my understanding. I thought that the discriminant must be known
>> before V.Y := 1.0; and hence there should be no confusion?
> 
> Imagine you have a function Evaluate (r : rec1_Type) return Float.
> Except in trivial cases like
>    if r.option1 = b then result := result + r.y; end if;
> the compiler cannot guess the value of the discriminant.
> 
Isn't the discriminant stored in the record ?

  parent reply	other threads:[~2020-12-31 13:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-31 10:38 Question on variant/discriminated records reinert
2020-12-31 10:52 ` J-P. Rosen
2020-12-31 12:24   ` reinert
2020-12-31 12:46     ` Gautier write-only address
2020-12-31 12:57       ` reinert
2020-12-31 13:29       ` DrPi [this message]
2020-12-31 16:06         ` Gautier write-only address
2020-12-31 15:03 ` Dmitry A. Kazakov
2021-01-01  9:19   ` reinert
replies disabled

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