From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Path: eternal-september.org!reader02.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!cleanfeed1-a.proxad.net!nnrp1-1.free.fr!not-for-mail Subject: Re: Question on variant/discriminated records Newsgroups: comp.lang.ada References: <3c1a2fe9-e8f2-401f-870d-aecd9e0f9c69n@googlegroups.com> <6dd44b3c-b3de-4943-ac70-0e25eaf279efn@googlegroups.com> From: DrPi <314@drpi.fr> Date: Thu, 31 Dec 2020 14:29:27 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Message-ID: <5fedd239$0$21616$426a74cc@news.free.fr> Organization: Guest of ProXad - France NNTP-Posting-Date: 31 Dec 2020 14:29:29 CET NNTP-Posting-Host: 82.65.30.55 X-Trace: 1609421369 news-3.free.fr 21616 82.65.30.55:54085 X-Complaints-To: abuse@proxad.net Xref: reader02.eternal-september.org comp.lang.ada:60990 List-Id: 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 ?