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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3957a46660bc0588 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-12 20:14:49 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!news.he.net!newsfeed1.easynews.com!easynews.com!easynews!elnk-pas-nf1!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread4.news.pas.earthlink.net.POSTED!not-for-mail From: Jeffrey Carter Organization: jrcarter commercial-at acm [period | full stop] org User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: strings and multidimensional arrays References: <3F88D320.80706@chartermi.net> <3F88E586.5060809@chartermi.net> <3F89621F.7070406@comcast.net> <3F89EB77.3030007@comcast.net> In-Reply-To: <3F89EB77.3030007@comcast.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Mon, 13 Oct 2003 03:14:49 GMT NNTP-Posting-Host: 63.184.9.89 X-Complaints-To: abuse@earthlink.net X-Trace: newsread4.news.pas.earthlink.net 1066014889 63.184.9.89 (Sun, 12 Oct 2003 20:14:49 PDT) NNTP-Posting-Date: Sun, 12 Oct 2003 20:14:49 PDT Xref: archiver1.google.com comp.lang.ada:760 Date: 2003-10-13T03:14:49+00:00 List-Id: 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