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,68f66270391b820 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-07-24 06:47:52 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!t-online.de!blackbush.xlink.net!blackbush.de.kpnqwest.net!news.uni-stuttgart.de!not-for-mail From: Peter Hermann Newsgroups: comp.lang.ada Subject: Re: Slices of 2d arrays? Date: Wed, 24 Jul 2002 13:47:51 +0000 (UTC) Organization: Comp.Center (RUS), U of Stuttgart, FRG Message-ID: References: NNTP-Posting-Host: iris16.csv.ica.uni-stuttgart.de X-Trace: news.uni-stuttgart.de 1027518471 20075 129.69.118.32 (24 Jul 2002 13:47:51 GMT) X-Complaints-To: news@news.uni-stuttgart.de NNTP-Posting-Date: Wed, 24 Jul 2002 13:47:51 +0000 (UTC) User-Agent: tin/pre-1.4-980117 (UNIX) (IRIX/6.5 (IP22)) Xref: archiver1.google.com comp.lang.ada:27361 Date: 2002-07-24T13:47:51+00:00 List-Id: Dale Stanbrough wrote: > I've always been under the impression that you could take a > horizontal slice of a 2d array, but for the life of me I can't > find it in the LRM, or get it to work. Does anyone know > whether this exists, or is it just a figment of my overworked > imagination? imagination is always a fine thing > I would like to be able to do... > type grid is array (1..10, 1..10) of character; > g : grid; > ... > put (g (1, 4..5)); Apart from the pragmatic solution (as Pascal Obry already proposed) for your special case: subtype s10 is string(1..10); type grid is array(1..10) of s10; begin g(1)(1) := 'x'; there may be an incentive for Ada2005 thoughts on index ranges in place of index position. I can not oversee all the implications which a language lawyer may see. Important may be the aspect: g(1 ,4 ) is of type character g(1..1,4..5) is of type grid g(1 ,4..5) is of type grid slice? g(1..1,4 ) is of type grid slice? and the n-dimensional arrays? No. Language designers will certainly refusei, IMHO. -- --Peter Hermann(49)0711-685-3611 fax3758 ica2ph@csv.ica.uni-stuttgart.de --Pfaffenwaldring 27 Raum 114, D-70569 Stuttgart Uni Computeranwendungen --http://www.csv.ica.uni-stuttgart.de/homes/ph/ --Team Ada: "C'mon people let the world begin" (Paul McCartney)