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,bae7ef2665942955 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-09-12 09:48:34 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: containers and garbage collections. Date: 12 Sep 2003 12:41:48 -0400 Organization: NASA Goddard Space Flight Center (skates.gsfc.nasa.gov) Message-ID: References: <2458809.CYNMQ0Kujp@linux1.krischik.com> NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 1063385056 24942 128.183.235.92 (12 Sep 2003 16:44:16 GMT) X-Complaints-To: usenet@news.gsfc.nasa.gov NNTP-Posting-Date: 12 Sep 2003 16:44:16 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 Xref: archiver1.google.com comp.lang.ada:42420 Date: 2003-09-12T16:44:16+00:00 List-Id: Martin Krischik writes: > Hello, > > with this article I want to bring two of my discussions together. > > On one side I am avocating garbage collection and one argument against it is > that proper container library will make garbage collection unneccesary. I agree; proper containers (and other algorithms) make garbage collection unnecessary. > One the other side I am avocating a more complete container librarys > and one argument against it is that one can allways use access > types. Well, one can always use assembly language, too. Containers are an excellent replacement for access types. > Without garbage collection access types are pain in the bud. Hmm. I guess I can agree with that. But garbage collection is a "pain in the bud" also; you can't use Finalization for good stuff, you can't predict when the garbage will be collected. I far prefer containers. > And when the container library only stores "type element is > private;" than one need to use access types as element. Yes. > I have proven that both options are possible I'm not sure which options you mean by "both options". > I have implemented a garbage collected storrage pool for GNAT. That's nice, and I hope you had fun doing it :). > I also have created containers for "type Element (<>) is abstract > tagged private;" Good. I'll have to look at it and compare it to SAL (http://www.toadmail.com/~ada_wizard/), which provides similar containers. > and I belive "type Element is array (Index range <>) of Item;" is > possible as well (Enabling collection of Strings). Yes; SAL containers can hold Ada strings, with appropriate storage management. Do either of your containers rely on the garbage collected storage pool? > Both can't be done with C++ templates - so we should not take the > all mighty STL as an example. Hmm. I haven't really looked, but I'd be very surprised if an STL container can't contain STL Strings. Of course, there is no such thing as "indefinite abstract tagged private" in C++. The closest thing is a class with only pure virtual member functions; that leaves out the "indefinite" part (implied by the (<>)). So to say "STL" can't do that isn't saying much; you're really just saying "C++ can't do that". I'm not clear what you mean by "don't take the STL as an example". Clearly the STL is limited by the expressiveness of C++; Ada is better. But the STL has proven to be a very useful library, because of the functionality it provides; it is reasonable to design an Ada library that has similar functionality, but takes full advantage of Ada to do it. I think that is your real goal? -- -- Stephe