comp.lang.ada
 help / color / mirror / Atom feed
From: "Martin Krischik" <Martin.Krischik@T-Online.de>
Subject: Re: Clueless :)
Date: Tue, 18 Mar 2003 17:37:02 +0100
Date: 2003-03-18T17:37:02+01:00	[thread overview]
Message-ID: <pan.2003.03.18.16.37.01.729269@T-Online.de> (raw)
In-Reply-To: qHEda.2435$wK6.104835@news.siol.net

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




  reply	other threads:[~2003-03-18 16:37 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 [this message]
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
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