comp.lang.ada
 help / color / mirror / Atom feed
From: Mark Lundquist <mark@rational.com>
Subject: Re: Variant Records
Date: 1999/09/14
Date: 1999-09-14T00:00:00+00:00	[thread overview]
Message-ID: <37DE93E8.383672D8@rational.com> (raw)
In-Reply-To: 202784de.3f456337@usw-ex0106-042.remarq.com

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?






  parent reply	other threads:[~1999-09-14  0:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-09-14  0:00 Variant Records Shawn Barber
1999-09-14  0:00 ` Matthew Heaney
1999-09-14  0:00 ` David C. Hoos, Sr.
1999-09-14  0:00 ` Mark Lundquist [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-02-15 22:51 Variant records Ganesh Ramasivan
2004-02-16 10:57 ` Preben Randhol
2004-02-16 15:25   ` Ganesh Ramasivan
2004-02-16 15:46     ` Ludovic Brenta
2004-02-16 16:16     ` Preben Randhol
2004-02-17 14:37       ` Ganesh Ramasivan
2004-02-17 15:43         ` Preben Randhol
2004-02-16 16:59   ` Ganesh Ramasivan
2004-02-16 20:14     ` Simon Wright
2004-02-17 14:56       ` Ganesh Ramasivan
2004-02-17 15:31         ` Robert I. Eachus
2004-02-16 23:17 ` tmoran
1986-10-31  9:08 variant records Dean Luick
1986-11-03 14:17 ` Bev Sobelman
1986-11-05 16:35 ` stuart
1986-11-06 15:40 ` stt
replies disabled

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