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=2.0 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,35edde140291c79e X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.232.42 with SMTP id tl10mr7938640pbc.7.1335500380837; Thu, 26 Apr 2012 21:19:40 -0700 (PDT) Path: r9ni103074pbh.0!nntp.google.com!news1.google.com!goblin1!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: "Nasser M. Abbasi" Newsgroups: comp.lang.ada Subject: Re: Can Ada iterate over Nd array? Date: Thu, 26 Apr 2012 23:19:38 -0500 Organization: Aioe.org NNTP Server Message-ID: References: <393172.2032.1335455290715.JavaMail.geo-discussion-forums@yntt13> Reply-To: nma@12000.org NNTP-Posting-Host: kFj7/sIUMPIKcKGY9HvaFw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: 2012-04-26T23:19:38-05:00 List-Id: On 04/26/2012 10:48 AM, Adam Beneschan wrote: > On Wednesday, April 25, 2012 11:02:13 PM UTC-7, Okasu wrote: >> On 2012-04-26, Jeffrey Carter wrote: >> > >> > type Three_D is array (1 .. 3, 7 .. 300, 'A' .. 'Z') of Integer; >> > >> > A : Three_D; >> > >> > for I in A'range (1) loop >> > for J in A'range (2) loop >> > for K in A'range (3) loop >> > -- Do something with A (I, J, K) >> > end loop; >> > end loop; >> > end loop; >> > >> >> It's a brain dead code. >> So you trying to say that i have to write loops for 10/100/1000d arrays >> by hand? > > I don't think I've *ever* seen an array with more than three dimensions ever used, in 35 years of programming. me neither. I guess OP is working in the unified field theory area as one of the the string theories (M-theory) contains 11 dimensional space-time continuum for it to be correct. But 1000 dimensions is something I can not understand. May be a new theory is in the works? > > But I think Ada 2012 does support what you're looking for; see the >example at the bottom of 5.5.2 (http://www.ada-auth.org/standards/12rm/html/RM-5-5-2.html). > > -- Adam That is very interesting. I will definitely need to convert some Ada code I wrote that uses 2D grids for solving a PDE using this new construct to see better how it works. I hope GNAT supports this new feature, I will have to find out. --Nasser