comp.lang.ada
 help / color / mirror / Atom feed
* How to loop (elegant) throug a vector ?
@ 2008-06-20 13:19 Reinert Korsnes
  2008-06-20 14:49 ` Pascal Obry
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Reinert Korsnes @ 2008-06-20 13:19 UTC (permalink / raw)


I try to learn to use Ada.Containers. 
Assume the following code:

   package X_t is new Vectors(Positive,Item_t);
   use X_t;
   X : Vector; 

-- I want something more beautiful than this loop:

   for k in 1 .. Positive(X.Length) loop
       do_something(X.Element(k));
   end loop;

Could anybody suggest improvements for the three
last lines in the code?

reinert




^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2008-06-23 17:14 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-20 13:19 How to loop (elegant) throug a vector ? Reinert Korsnes
2008-06-20 14:49 ` Pascal Obry
2008-06-20 17:12 ` Returning ranges from a function (was: How to loop (elegant) throug a vector ?) Stefan Bellon
2008-06-22 14:01   ` Maciej Sobczak
2008-06-22 18:47     ` Stefan Bellon
2008-06-22 21:06       ` Maciej Sobczak
2008-06-23  9:47         ` Stefan Bellon
2008-06-23 12:06           ` Maciej Sobczak
2008-06-23 12:28             ` christoph.grein
2008-06-20 19:21 ` How to loop (elegant) throug a vector ? Jeffrey R. Carter
2008-06-20 19:48   ` Reinert Korsnes
2008-06-20 23:25     ` Jeffrey R. Carter
2008-06-23 17:14     ` Matthew Heaney
2008-06-23 17:11   ` Matthew Heaney
2008-06-23 17:08 ` Matthew Heaney

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