comp.lang.ada
 help / color / mirror / Atom feed
From: bglbv@my-dejanews.com
Subject: Re: Can I have an array of variant records?
Date: 1999/04/21
Date: 1999-04-21T00:00:00+00:00	[thread overview]
Message-ID: <87k8v5oazn.fsf@bglbv.my-dejanews.com> (raw)
In-Reply-To: 7fk8c6$mbe$1@nnrp1.dejanews.com

Robert Dewar <robert_dewar@my-dejanews.com> writes:

> <<incorrect information snipped, in which he answers this
> question with a no, instead of a yes>>

Thank you for the correction. (As a perhaps feeble defense, I'll
point out that my answer was "not that I can see", which is a
rather tentative form of "no".)

> To expand on my previous short message. Just declare the
> type with a default discriminant. In this case you can
> freely alter the discriminant value later on, and such
> types compose freely (although some old compilers, notably
> the Alsys Ada 83 compiler had rather severe size
> limitations on the composition of such types).
> 
> Of course typical compilers will allocate the maximum space
> for each element, so if this is not acceptable, you will
> indeed need to use pointers.

Aha. So it isn't enough _in practice_ to give the discriminant a
default value: one also needs to pick its subtype carefully.
How big is Positive'Last on a typical implementation, I wonder?
(>= 32767, I know.) Still, this looks cleaner than my Bounded_String
suggestion.




  reply	other threads:[~1999-04-21  0:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-04-20  0:00 Can I have an array of variant records? Josh Highley
1999-04-20  0:00 ` bglbv
1999-04-21  0:00   ` Robert Dewar
1999-04-21  0:00     ` bglbv [this message]
1999-04-22  0:00       ` dennison
1999-04-21  0:00     ` Pawel Kobylarz
1999-04-21  0:00       ` David C. Hoos, Sr.
1999-04-21  0:00         ` Robert Dewar
1999-04-21  0:00       ` dennison
1999-04-21  0:00         ` Robert Dewar
1999-04-22  0:00           ` Josh Highley
1999-04-23  0:00           ` Pawel Kobylarz
1999-04-21  0:00       ` czgrr
1999-04-21  0:00 ` Robert Dewar
1999-04-22  0:00 ` Maybe not exactly a variant record Josh Highley
1999-04-22  0:00   ` dennison
1999-04-23  0:00     ` Nick Roberts
replies disabled

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