comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Can Ada iterate over Nd array?
Date: Thu, 26 Apr 2012 19:36:10 -0500
Date: 2012-04-26T19:36:10-05:00	[thread overview]
Message-ID: <jncplv$62p$1@munin.nbi.dk> (raw)
In-Reply-To: 18y0zty0yw1m3.1dkfnp5etqdk0$.dlg@40tude.net

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> 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.





  reply	other threads:[~2012-04-27  0:36 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-26  4:42 Can Ada iterate over Nd array? Okasu
2012-04-26  5:36 ` Jeffrey Carter
2012-04-26  6:02   ` Okasu
2012-04-26  6:05     ` Okasu
2012-04-26 10:57       ` ytomino
2012-04-26  8:01     ` Dmitry A. Kazakov
2012-04-27  0:36       ` Randy Brukardt [this message]
2012-04-27  1:58         ` Jerrid Kimball
2012-04-27  7:39           ` Martin
2012-04-27 18:08             ` Jeffrey Carter
2012-04-30  7:20               ` Martin
2012-04-30 13:21                 ` Robert A Duff
2012-04-30 15:42                   ` Martin
2012-04-27 16:06         ` Shark8
2012-04-26  9:00     ` Georg Bauhaus
2012-04-26 15:48     ` Adam Beneschan
2012-04-26 20:54       ` Okasu
2012-04-27  0:39       ` Randy Brukardt
2012-04-27 13:30         ` Robert A Duff
2012-04-28  8:24           ` Georg Bauhaus
2012-04-28  9:35             ` björn lundin
     [not found]               ` <raadncdcv9V-hgHSnZ2dnUVZ_v2dnZ2d@earthlink.com>
2012-04-28 23:19                 ` björn lundin
2012-04-30 14:48               ` gautier_niouzes
2012-05-01  2:02           ` Randy Brukardt
2012-04-27  4:19       ` Nasser M. Abbasi
2012-04-27 16:23       ` Bill Findlay
2012-04-26  9:40 ` gautier_niouzes
     [not found] ` <26754113.2767.1335431755764.JavaMail.geo-discussion-forums@vbki8>
2012-04-26 18:09   ` Jeffrey Carter
2012-04-27  0:28     ` BrianG
2012-04-27 13:46       ` Robert A Duff
2012-04-27 11:09 ` Stephen Leake
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox