From: Jeffrey Carter <spam@spam.com>
Subject: Re: strings and multidimensional arrays
Date: Mon, 13 Oct 2003 03:14:49 GMT
Date: 2003-10-13T03:14:49+00:00 [thread overview]
Message-ID: <JMoib.8968$dn6.4651@newsread4.news.pas.earthlink.net> (raw)
In-Reply-To: <3F89EB77.3030007@comcast.net>
Robert I. Eachus wrote:
> You can't have an array of unconstrained records, and Content is an
> unconstrained record type. (Try it.) Wrapper is a constrained type, even
> though it has an unconstrained record type within it.
I have. It works, at least with GNAT 3.15p. The following compiles:
package Test_Unconstrained_Record_Array is
type Disc is (One, Two, Five);
type Unconstrained_Record (D : Disc := One) is record
case D is
when One =>
I : Integer;
when Two =>
C : Character;
when Five =>
F : Float;
end case;
end record;
type Thing is array (Positive range <>, Positive range <>) of
Unconstrained_Record;
end Test_Unconstrained_Record_Array;
> Or I could just say that it was necessary magic. ;-)
Is GNAT wrong, or is it unnecessary magic? I've been doing this since
1984. I know you can't have an array of indefinite elements (an
unconstrained array type, such as String, or a type with unknown
discriminants), but unconstrained records types are not indefinite.
--
Jeff Carter
"Sons of a silly person."
Monty Python & the Holy Grail
02
next prev parent reply other threads:[~2003-10-13 3:14 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-10-12 4:05 strings and multidimensional arrays Andrew
2003-10-12 5:24 ` Andrew
2003-10-12 6:27 ` tmoran
2003-10-12 14:16 ` Robert I. Eachus
2003-10-12 19:34 ` Jeffrey Carter
2003-10-13 0:02 ` Robert I. Eachus
2003-10-13 3:14 ` Jeffrey Carter [this message]
2003-10-13 17:05 ` Robert I. Eachus
2003-10-13 18:49 ` Martin Dowie
2003-10-13 21:47 ` Mark Lorenzen
2003-10-14 1:10 ` Jeffrey Carter
2003-10-14 15:29 ` Robert I. Eachus
2003-10-12 21:01 ` Andrew
2003-10-13 13:59 ` Rodrigo Garcia
-- strict thread matches above, loose matches on Subject: below --
2003-10-14 6:24 christoph.grein
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox