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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,87a27a72dee21611 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-10-14 00:39:24 PST Newsgroups: comp.lang.ada Path: bga.com!news.sprintlink.net!crash!telesoft!kst From: kst@alsys.com (Keith Thompson @pulsar) Subject: Re: Change in behavior of & operator between 83 and 9x? Message-ID: Sender: news@alsys.com (USENET News Admin @flash) Organization: Alsys Group, San Diego, CA, USA References: <19941006.090935.490@vnet.ibm.com> Date: Thu, 13 Oct 1994 01:43:46 GMT Date: 1994-10-13T01:43:46+00:00 List-Id: In <19941006.090935.490@vnet.ibm.com> karthurs@vnet.ibm.com (Keith Arthurs) writes: > In article , > on 05 Oct 1994 16:04:49 GMT, > Paul Graham writes: > > > >If an array type A has component type B which is itself an array type, is it > >possible to concatenate two arrays of type B to produce an array of type A? > >For instance: > > > > package foo is > > type my_string is array(1 .. 3) of character; > > type my_string_vector is array(positive range <>) of my_string; > > c1 : my_string_vector := "abc" & "def"; > > In Ada 83 'my_string_vector' would need to be constrained (1 .. 2) > (lrm 3.6.1:6) > > > end; > > > >In this example, I want the value of the concanenation to be equivalent to > > > > ("abc", "def") -- my_string_vector(1 to 2) > > This is a correct interpretation of 'my_string_vector', it is a two > dimensional array A quibble: it's not a two dimensional array, it's a one dimensional array whose component type is also a one dimensional array. (Unlike Pascal, for example, Ada does distinguish between these two cases.) For example: type Array_1d is array(1 .. 3) of Integer; type Array_1d_1d is array(1 .. 3) of Array_1d; -- -- Array_1d_1d is a 1-d array of 1-d arrays -- type Array_2d is array(1 .. 3, 1 .. 3) of Integer; -- -- Array_2d is a 2-d array -- Just to add to the confusion, both types use the same syntax for aggregates: Obj_1d_1d: Array_1d_1d := (1 => (1, 2, 3), 2 => (4, 5, 6), 3 => (7, 8, 9)); Obj_2d: Array_2d := (1 => (1, 2, 3), 2 => (4, 5, 6), 3 => (7, 8, 9)); -- Keith Thompson (The_Other_Keith) kst@alsys.com TeleSoft^H^H^H^H^H^H^H^H Alsys, Inc. 10251 Vista Sorrento Parkway, Suite 300, San Diego, CA, USA, 92121-2718 /user/kst/.signature: I/O error (core dumped)