comp.lang.ada
 help / color / mirror / Atom feed
From: mheaney@on2.com (Matthew Heaney)
Subject: Re: Using Grace.Lists.Unbounded in WindowsXP/GNAT3.15p
Date: 13 Mar 2003 08:26:37 -0800
Date: 2003-03-13T16:26:38+00:00	[thread overview]
Message-ID: <1ec946d1.0303130826.480cd301@posting.google.com> (raw)
In-Reply-To: 3e705a78$1@news.wineasy.se

"Frank" <franjoe@frisurf.no> wrote in message news:<3e705a78$1@news.wineasy.se>...
> 
> The big picture(but not fully coded in this example):
> What I want to achieve is to be able to traverse a list, and based on
> information in the
> node, decide to remove it from the current position in the list and reinsert
> it at the end.
> This is done to postpone the calculation of the Node until all other Nodes
> have been calculated.

You said you're using GRACE, but here's how you'd do it in Charles:

procedure Op (List : in List_Subtype) is
   I : Iterator_Type := First (List);
   J : constant Iterator_Type := Back (List);
begin
   while I /= J loop
      declare
         E : Element_Subtype renames To_Access (I).all;   
      begin
         if Predicate (E) then
            Splice (List, Before => J, Iterator => I);
            return;
         end if;
      end;

      I := Succ (I);
   end loop;
end Op;

http://home.earthlink.net/~matthewjheaney/charles/



      parent reply	other threads:[~2003-03-13 16:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-13 10:16 Using Grace.Lists.Unbounded in WindowsXP/GNAT3.15p Frank
2003-03-13 14:51 ` Stephen Leake
2003-03-13 15:56   ` Frank
2003-03-13 16:26 ` Matthew Heaney [this message]
replies disabled

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