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-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.125.233 with SMTP id mt9mr7481178pbb.5.1335486976675; Thu, 26 Apr 2012 17:36:16 -0700 (PDT) MIME-Version: 1.0 Path: r9ni102476pbh.0!nntp.google.com!news2.google.com!news1.google.com!news.glorb.com!feeder.erje.net!nuzba.szn.dk!news.jacob-sparre.dk!munin.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Can Ada iterate over Nd array? Date: Thu, 26 Apr 2012 19:36:10 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <18y0zty0yw1m3.1dkfnp5etqdk0$.dlg@40tude.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1335486975 6233 69.95.181.76 (27 Apr 2012 00:36:15 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Fri, 27 Apr 2012 00:36:15 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Date: 2012-04-26T19:36:10-05:00 List-Id: "Dmitry A. Kazakov" wrote in message news:18y0zty0yw1m3.1dkfnp5etqdk0$.dlg@40tude.net... > On Thu, 26 Apr 2012 06:02:13 +0000 (UTC), Okasu wrote: > >> So you trying to say that i have to write loops for 10/100/1000d arrays >> by hand? > > You should introduce an index type of your own (a Nth tuple) and use a > flat > container, e.g. a map over that index. > > Unfortunately Ada does not have 1st class indices, which was #10 in my > wish > list for Ada 202X. It does, however, have 2nd class indices (see 4.1.6), which work better than first class indicies most of the time. Also, you can iterate over the entire array without using any indicies in Ada 2012: for E of A loop null; end loop; This also works for containers. But this doesn't work in earlier versions of Ada. Randy.