From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_05,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d3118bd0aa46477d X-Google-Attributes: gid103376,public From: Mark Lundquist Subject: Re: Variant Records Date: 1999/09/14 Message-ID: <37DE93E8.383672D8@rational.com>#1/1 X-Deja-AN: 525083681 Content-Transfer-Encoding: 7bit References: <202784de.3f456337@usw-ex0106-042.remarq.com> Organization: Rational Software Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-09-14T00:00:00+00:00 List-Id: Shawn Barber wrote: > I have recently run into a small problem using variant > records. I have been forced (against my better judgement) to > use a data structure consisting of a variant record, and in > this variant record a field of a particular variant is > another variant record. I already know the pain which has > been inflicted by using such a data structure. My question > is when I do a compare, say Var_1 = Var_2 or an assignment > are the fields compaired/assigned field by field or all at > once or in some other manor? Thanks. You mean, if you examined the generated code would you be able to identify discrete comparisons of each field, as opposed to, say, a big block-compare? Is that the idea? If so, the answer is that it depends on your implementation and on exactly what the type declaration looks like. Did you know that you can use constrained subtypes to catch (in some cases, at compile time) places where the discriminant values aren't right (don't make sense, etc.)? I don't know if this helps you or not -- just a hunch... Why do you care how equality is tested?