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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,a81d7835683dac7b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-09-11 08:16:13 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsmm00.sul.t-online.com!t-online.de!news.t-online.com!not-for-mail From: Martin Krischik Newsgroups: comp.lang.ada Subject: Re: Bases 1.52 Date: Thu, 11 Sep 2003 17:03:18 +0200 Organization: AdaCL Message-ID: <1301057.xhkpTmYQhd@linux1.krischik.com> References: <4a4de33a.0309021059.53f71234@posting.google.com> <4060780.x1l89WMggb@linux1.krischik.com> <17eddf9f.0309092349.2ff22de2@posting.google.com> Reply-To: krischik@users.sourceforge.net Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 8Bit X-Trace: news.t-online.com 1063293324 05 4555 WA0PVLXSSdAphp 030911 15:15:24 X-Complaints-To: usenet-abuse@t-online.de X-ID: ThV+8BZf8enznEOh0jgNt15MI9MbzqEnPz3tJQ4vs5Pq3ECHB0OGZ4 User-Agent: KNode/0.7.2 Xref: archiver1.google.com comp.lang.ada:42382 Date: 2003-09-11T17:03:18+02:00 List-Id: M�rio Amado Alves wrote: > Martin Krischik wrote: >> Bases 1.52 >> >> 51 This parameter shall have the signature >> type Element (<>) is private; >> >> Why restrict to just one signature? >> >> I have made very good experiences with containers based on: >> >> type Item (<>) is abstract tagged private; >> >> This frees my applications from using heap memory when I need to store >> Item'Class instances.... > > I'm not sure about the memory management implications, but doesn't the > first signature include the second, in the sense that it accepts > tagged actuals? Yes, but to my knowlege you cant say: type Item'Class is private; so I use: generic type Element(<>) is abstract tagged private; -- Pointer to be used type P is access T'Class; package BC.Support.Tagged_Reference is function Create ( Value : T'Class) return Pointer; Function Create uses T'Class - that is an kind of class. As for the memory management implications, Ada - unline C++, allows: function Create ( Value : T'Class) return Pointer is begin return Pointer'(Ada.Finalization.Controlled with Value => new T'Class'(Value)); end Create; No T::clone () needed. > Restricting to just one signature is simply to keep the library small. Shure, but one often likes to store Strings or a decendant of a tagged type. With Strings one can use Unbounded_Strings but with tagged type on is lost. Besides, Sun did not keep the Java Library small. In fact the Java Library is huge. And Java is more successfull. Or Python. The Python Library is huge and there are 2641 python project on source forge and ony 67 Ada projects. And creating additional collection class from one which allready exists is not that difficult. In fact is is so easy that I create them with a text search and replace tool. With Regards Martin -- mailto://krischik@users.sourceforge.net http://www.ada.krischik.com