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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5fc9b87ca6f5fbaf,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-05-12 18:17:13 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!c03.atl99!news.webusenet.com!pc01.webusenet.com!fe06.atl2.webusenet.com.POSTED!not-for-mail Message-ID: <3EC0494F.A7D67AA4@bellsouth.net> From: "gshibona @ b e l l s o u t h . n e t" X-Mailer: Mozilla 4.78 [en] (X11; U; Linux 2.4.7-10 i686) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: array slices Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@usenetserver.com X-Abuse-Info: Please be sure to forward a copy of ALL headers X-Abuse-Info: Otherwise we will be unable to process your complaint properly. NNTP-Posting-Date: Mon, 12 May 2003 21:09:57 EDT Date: Mon, 12 May 2003 21:24:31 -0400 Xref: archiver1.google.com comp.lang.ada:37254 Date: 2003-05-12T21:24:31-04:00 List-Id: I wonder if someone could point to the error in this code. I'm looking to fill array a with a "row" slice of array c. There doesn't appear to be much info on this particular facet of Ada, yet what I have seen suggests that the syntax below is correct. procedure ada_2daryslice is a : array(1..4) of integer; c : array( 1..2, 1..4 ) of integer; begin c := ( 1 => (0, 1, 2, 4 ), 2 => (8, 16, 32, 64) ); -- this seems to yield the expected results a(1..4) := ( 1,2,3,4); -- however, this does not... a(1..4) := c(1)(1..4); end ada_2daryslice; The compiler complains of too few subscripts in the array reference. To wit... gnatmake -g -gnatv ada2daryslice.adb gnatgcc -c -g -gnatv ada2daryslice.adb GNAT 3.13p (20000509) Copyright 1992-2000 Free Software Foundation, Inc. Compiling: ada2daryslice.adb (source file time stamp: 2003-05-13 01:20:09) 17. a(1..4) := c(1)(1..4); | >>> too few subscripts in array reference 17 lines: 1 error gnatmake: "ada2daryslice.adb" compilation error It's quite possible that I've been looking at this for much too long to be objective. Thanks in advance for any help. Ger