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-13 18:10:42 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newshub.sdsu.edu!elnk-nf2-pas!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> <3F8ADB3D.5010000@comcast.net> In-Reply-To: <3F8ADB3D.5010000@comcast.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Tue, 14 Oct 2003 01:10:42 GMT NNTP-Posting-Host: 63.184.17.143 X-Complaints-To: abuse@earthlink.net X-Trace: newsread4.news.pas.earthlink.net 1066093842 63.184.17.143 (Mon, 13 Oct 2003 18:10:42 PDT) NNTP-Posting-Date: Mon, 13 Oct 2003 18:10:42 PDT Xref: archiver1.google.com comp.lang.ada:796 Date: 2003-10-14T01:10:42+00:00 List-Id: Robert I. Eachus wrote: > E:\Ada\Test>disc_test > disc_test > TT(1,1) is ( D => ONE I => 1). > TT(2,2) is ( D => TWO C =>'2'). > TT(3,3) is ( D => ONE I => 2013340188). > TT(4,4) is ( D => ONE I => 38010744). > TT(5,5) is ( D => FIVE I => 5.0). This is about what I expected. We could provide default values for I, C, and F, and avoid the "stack junk" values for I in (3,3) and (4,4). Or assigned an initial value to TT. > I'm not going to assert that this is wrong. That would be for the ARG as > a whole to do. The key paragraphs of the standard are 3.6(14): "An > array_type_definition defines an array type and its first subtype. > For each object of this array type, the number of indices, the type and > position of each index, and the subtype of the components are as in the > type definition[; the values of the lower and upper bounds for each > index belong to the corresponding index subtype of its type, except for > null arrays (see 3.6.1)]." This is the paragraph that implicitly sets > the discriminants for uninitialized components. Is the subtype of X : Discriminated_Record; the same as of Y : Discriminated_Record (D => One); ? The discriminant of X can change; of Y cannot. > The first quote implies that the subtype of the components can't be > changed, the second implies they can be unless the components are > declared as aliased. (Adding the wrapper type allows you to declare the > components aliased.) I'll wait to see what Bob Duff, Randy, and > possibly Tucker have to say. Certainly this is not documented as a > change from Ada 83 in the AARM. But even if it wasn't intended as > legal, it is a nice feature. ;-) That's a consequence of aliased I hadn't encountered, and the wrapper trick is a good thing to know. I didn't realize I was getting into an area that would require attention from the ARG. It seems like a significant incompatability from Ada 83 not to allow assignment to "normal" unconstrained record components. -- Jeff Carter "When danger reared its ugly head, he bravely turned his tail and fled." Monty Python and the Holy Grail 60