comp.lang.ada
 help / color / mirror / Atom feed
From: Karel Miklav <karel@inetis.spppambait.com>
Subject: Re: Clueless :)
Date: Fri, 21 Mar 2003 10:26:58 +0100
Date: 2003-03-21T10:26:58+01:00	[thread overview]
Message-ID: <EVAea.2582$wK6.108581@news.siol.net> (raw)
In-Reply-To: <x7vfzphycrc.fsf@smaug.pushface.org>

Simon Wright wrote:
 > The impetus behind the bounded forms is to avoid memory allocation. Of
 > course, one of the reasons for doing this is because of a need for
 > high dependability (safety-related software, for instance) and I doubt
 > that anyone in such an enviromnent will be using off-the-shelf
 > component libraries. But if you just want to avoid heap fragmentation
 > they can help.

Sorry, I completely forgot about that. In my business I usually don't 
know the number of types in advance, and can only speculate about orders 
of magnitude of items.

 > I do take the point that the first thing I show people in the case
 > study ought to be the simplest thing for them to do; that is now done
 > using the (new) Unmanaged form, which doesn't require you to specify a
 > storage manager (and which should work with GNAT 3.12 for those fixed
 > in the past).

The tutorial should also show how to fill the container. I was not able 
to find a simple and complete example nowhere, then I've figured it out 
from tests. The next step of learning is probably looking into the 
sources. I would send my examples, but some people may die laughing :) 
Maybe Ada community needs a Wiki?

And yes: do I always have to make separate initialization packages, 
because GNAT chokes on this:


with bc.containers.collections.bounded;

procedure club is

    type person is
       record
          name : string (1 .. 4);
          age  : integer range 0 .. 150;
       end record;

    package container is new bc.containers (person);
    package collection is new container.collections;
    package people is new collection.bounded(maximum_size => 100);

    club : people.collection;

begin

    people.append(club,(name => "nivi", age => 22));

end club;


 > You might say, wouldn't this new Unmanaged better be called Unbounded,
 > and rename the present Unbounded to Managed? ... well, yes, but the
 > people out there using the BCs wouldn't thank me!

If these component are not some kind of joke I would consider doing a 
fork in cases like this. You owe it to the kids too :)

Regards, and thank you for the good work.
Karel Miklav




  parent reply	other threads:[~2003-03-21  9:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-18 12:55 Clueless :) Karel Miklav
2003-03-18 16:37 ` Martin Krischik
2003-03-20 21:00   ` Simon Wright
2003-03-21  7:39     ` Karel Miklav
2003-03-21  8:34     ` Karel Miklav
2003-03-21  9:26     ` Karel Miklav [this message]
2003-03-21 18:01       ` Simon Wright
2003-03-18 20:42 ` Matthew Heaney
2003-03-19  6:43   ` Karel Miklav
2003-03-19  2:21 ` Jeffrey Carter
replies disabled

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