Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Ada > Re: limited typ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 15 of 26 Topic 4222 of 5930
Post > Topic >>

Re: limited types (Was: Records that could be arrays)

by "Matthew Heaney" <mheaney@[EMAIL PROTECTED] > Feb 27, 2006 at 08:52 AM

Dmitry A. Kazakov wrote:
>
> 1. Passing as a parameter

Just pass a cursor:

procedure Op (C : in out Container_Type) is
begin
   Do_Something (C.First);
   ...
end;

You know you've run out of elements when Has_Element returns False.


> 2. Copying

while (Has_Element (C) loop
  Put_Element_Somewhere (Element (C);
end loop;

> 3. Merging

You'll need to define a relational operator over your element type, but
then you can say:

Merge (C1.First, C2.First);


> 4. Slicing

Just use a cursor pair:

Do_Something (C1, C2);  -- half-open range


> 5. Closures and simultaneous traversal of two or more containers

Do_Something (C1, C2);


> 6. Relational operations on sets of containers

Compare (C1, C2);


If you don't understand this, go to

http://charles.tigris.org

and browse the Charles.Algorithms subsystem.  (Things are a little
different for the Ada 2005 container library, but it should give you
the general idea.)
 




 26 Posts in Topic:
limited types (Was: Records that could be arrays)
Thierry Bernier <email  2006-02-24 16:51:03 
Re: limited types (Was: Records that could be arrays)
"Randy Brukardt"  2006-02-24 15:57:46 
Re: limited types (Was: Records that could be arrays)
Matthew Heaney <matthe  2006-02-25 02:21:13 
Re: limited types (Was: Records that could be arrays)
Matthew Heaney <matthe  2006-02-25 03:38:59 
Re: limited types (Was: Records that could be arrays)
"Dmitry A. Kazakov&q  2006-02-25 12:06:20 
Re: limited types (Was: Records that could be arrays)
Matthew Heaney <matthe  2006-02-25 15:05:02 
Re: limited types (Was: Records that could be arrays)
"Randy Brukardt"  2006-02-25 19:01:06 
Re: limited types (Was: Records that could be arrays)
"Dmitry A. Kazakov&q  2006-02-26 10:00:07 
Re: limited types (Was: Records that could be arrays)
Matthew Heaney <matthe  2006-02-26 18:20:39 
Re: limited types (Was: Records that could be arrays)
"Dmitry A. Kazakov&q  2006-02-26 21:52:32 
Re: limited types (Was: Records that could be arrays)
Matthew Heaney <matthe  2006-02-26 22:07:00 
Re: limited types (Was: Records that could be arrays)
"Dmitry A. Kazakov&q  2006-02-27 10:11:28 
Re: limited types (Was: Records that could be arrays)
Georg Bauhaus <bauhaus  2006-02-27 15:34:58 
Re: limited types (Was: Records that could be arrays)
"Dmitry A. Kazakov&q  2006-02-27 17:05:47 
Re: limited types (Was: Records that could be arrays)
"Matthew Heaney"  2006-02-27 08:52:23 
Re: limited types (Was: Records that could be arrays)
"Dmitry A. Kazakov&q  2006-02-27 21:21:08 
Re: limited types (Was: Records that could be arrays)
Georg Bauhaus <bauhaus  2006-02-27 22:40:18 
Re: limited types (Was: Records that could be arrays)
"Dmitry A. Kazakov&q  2006-02-28 10:38:31 
Re: limited types (Was: Records that could be arrays)
"Matthew Heaney"  2006-02-27 15:00:29 
Re: limited types (Was: Records that could be arrays)
"Dmitry A. Kazakov&q  2006-02-28 10:39:20 
Re: limited types (Was: Records that could be arrays)
"Matthew Heaney"  2006-02-28 09:24:35 
Re: limited types (Was: Records that could be arrays)
"Dmitry A. Kazakov&q  2006-02-28 20:06:50 
Re: limited types (Was: Records that could be arrays)
"Matthew Heaney"  2006-02-28 11:58:11 
Re: limited types (Was: Records that could be arrays)
"Dmitry A. Kazakov&q  2006-02-28 22:03:37 
Re: limited types
Simon Wright <simon@[E  2006-02-28 21:51:52 
Re: limited types
Matthew Heaney <matthe  2006-03-01 01:59:16 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Oct 12 22:28:02 CDT 2008.