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!weretis.net!feeder8.news.weretis.net!lilly.ping.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: Performance of records with variant parts Date: Thu, 1 Apr 2021 16:38:46 +0300 Organization: Tidorum Ltd Message-ID: References: <07a56dcc-9e17-49b2-a980-3a5a2d265cedn@googlegroups.com> <23dcce3e-0db1-4417-a5d1-a05f03f74464n@googlegroups.com> <302c2e86-2379-46e0-b1f7-d69e7e14f9cfn@googlegroups.com> <86h7kyapsn.fsf@stephe-leake.org> <3b3ff9aa-26b9-4da7-82de-a5f6c1980335n@googlegroups.com> <8f009bf0-d5a3-42b8-9bd9-12bce24f1093n@googlegroups.com> <9233bc10-091c-46af-b613-504bcb5e1c82n@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net Zct7DK5PCho5ANqCtHgbcABr8+qKew+gZrHpp31wMnI/XfH0HS Cancel-Lock: sha1:N751qHM6wCP2PiCXUjKyLEVVm6w= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 In-Reply-To: <9233bc10-091c-46af-b613-504bcb5e1c82n@googlegroups.com> Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:61720 List-Id: On 2021-04-01 3:03, John Perry wrote: > A function returns an Intersection_Type, which has several fields, > one of which was a Thing_Type. So if Thing_Type is variant, > Intersection_Type also has to be variant. No. I assume by "X is variant" you mean that X has a variant_part (RM 3.8.1(2)). If the discriminant of Thing_Type has a default value, Intersection_Type can have a Thing_Type component without supplying it with a discriminant value, and Intersection_Type need not have discriminants nor a variant part.