From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,58bffef5eda29ec X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-03-21 01:27:02 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!proxad.net!teaser.fr!newsfeed.stueberl.de!newsfeed.eunet.at!newsfeed.eunet.at!news-hub.siol.net!news.siol.net!not-for-mail From: Karel Miklav User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.2.1) Gecko/20021130 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Clueless :) References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Fri, 21 Mar 2003 10:26:58 +0100 NNTP-Posting-Host: 193.77.153.232 X-Complaints-To: abuse@siol.net X-Trace: news.siol.net 1048238820 193.77.153.232 (Fri, 21 Mar 2003 10:27:00 MET) NNTP-Posting-Date: Fri, 21 Mar 2003 10:27:00 MET Organization: Slovenija OnLine - SiOL Xref: archiver1.google.com comp.lang.ada:35589 Date: 2003-03-21T10:26:58+01:00 List-Id: 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