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 X-Received: by 2002:a05:6214:a62:: with SMTP id ef2mr13402715qvb.44.1617379640060; Fri, 02 Apr 2021 09:07:20 -0700 (PDT) X-Received: by 2002:a25:6610:: with SMTP id a16mr18208456ybc.339.1617379639879; Fri, 02 Apr 2021 09:07:19 -0700 (PDT) Path: eternal-september.org!reader02.eternal-september.org!news.mixmin.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 2 Apr 2021 09:07:19 -0700 (PDT) In-Reply-To: Injection-Info: google-groups.googlegroups.com; posting-host=2601:3c3:401:f550:a0ea:df62:23aa:cb77; posting-account=JSxOkAoAAADa00TJoz2WZ_46XrZCdXeS NNTP-Posting-Host: 2601:3c3:401:f550:a0ea:df62:23aa:cb77 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> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <92cd977d-f848-4619-9ff8-e0d5fdaa76dan@googlegroups.com> Subject: Re: Performance of records with variant parts From: John Perry Injection-Date: Fri, 02 Apr 2021 16:07:20 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader02.eternal-september.org comp.lang.ada:61729 List-Id: On Thursday, April 1, 2021 at 8:38:49 AM UTC-5, Niklas Holsti wrote: > I assume by "X is variant" you mean that X has a variant_part (RM 3.8.1(2= )).=20 >=20 > If the discriminant of Thing_Type has a default value, Intersection_Type= =20 > can have a Thing_Type component without supplying it with a discriminant= =20 > value, and Intersection_Type need not have discriminants nor a variant pa= rt. You're right. Originally Thing_Type didn't have a default value. Later I ad= ded one, but I didn't think to change Intersection_Type. Either way, the discriminant on Intersection_Type was the problem. Once I m= odify Intersection_Type so that it is no longer variant, Intersections can = return an Intersection_Type that contains a Thing_Type without the performa= nce hit it had when Intersection_Type was variant.