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,FREEMAIL_FROM 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-19 00:52:08 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!feed.news.nacamar.de!newsfeed01.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: Clueless :) Date: Tue, 18 Mar 2003 17:37:02 +0100 Organization: never organized Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 X-Trace: news.t-online.com 1048063743 03 13309 zluIE9lbS-YJzr 030319 08:49:03 X-Complaints-To: abuse@t-online.com X-ID: GhlQ3qZ-rebBE+UjUfnuq2WuxITO-fLmEcI1jnoluuGZDDO8EVMxUg User-Agent: Pan/0.13.0 (The whole remains beautiful) Xref: archiver1.google.com comp.lang.ada:35501 Date: 2003-03-18T17:37:02+01:00 List-Id: On Tue, 18 Mar 2003 13:55:34 +0100, Karel Miklav wrote: > Learning Ada I'm playing with container libraries and there are some > things puzzling me. If I initialize a generic container with an abstract > data type, this container will copy the whole ADT through and forth on > every assignment and alike. Isn't this an overkill? > > As I understand he gets in an iterator to increase, but he throws it > away and creates another one. Is it so cheap or am I missunderstanding > something about Ada compilers or something? Some Classes are indeed so lightweight that it is indeed aceptable to create a new instance. BTW: The old instance is not thown away. The caller of the function can still use that copy. > And one more question about the concept supported by keywords bounded, These are not keywords just identifier. > unbounded, dynamic, fixed-length etc. Like first I must admit I don't > get it; why is there a need for this in Ada, when in tens of other > languages I've seen there is not? And why there are bounded, unbounded > and dynamic versions of Booch components but no polymorphic? Are people > really making collections of 30 (the number is not important but the > last time I made a fixed structure it was on C64 long time ago) elements > like Simon Wright in his Case study? Large collection class librarys usualy have theese options (i.E. IBM Open Class Library - that C++). They somtetimes have different namens. The Idea is flexibility against speed. In Booch bounded are the fastest but as the name suggest not very flexible. Unbouded is the most flexible. 30 elements? Well, I use collections (with IBMs OCL) with up to 15.000 elements. Important is to use the right collection for you data and then performace is even with > 10.000 elements quite aceptable. With Regards Martin -- Martin Krischik mailto://Martin@krischik.com http://ada.krischik.com