comp.lang.ada
 help / color / mirror / Atom feed
From: Karel Miklav <karel@inetis.spppambait.com>
Subject: Clueless :)
Date: Tue, 18 Mar 2003 13:55:34 +0100
Date: 2003-03-18T13:55:34+01:00	[thread overview]
Message-ID: <qHEda.2435$wK6.104835@news.siol.net> (raw)

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?

Then John English in his book "Ada 95: The Craft of Object-Oriented 
Programming" is doing this:

function Succ (Iterator : Diary_Iterator) return
Diary_Iterator is
begin
     if Iterator.List = null or else Iterator.Current = null then
         raise Iterator_Error;
     else
         return (List => Iterator.List,
                 Current => Iterator.Current.Next);
     end if;
end Succ;

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?

And one more question about the concept supported by keywords bounded, 
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?

Sory folks, I'm desperate and nobody speaks Ada here :) Please tell me 
what am I missing.

Regards,
Karel Miklav




             reply	other threads:[~2003-03-18 12:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-18 12:55 Karel Miklav [this message]
2003-03-18 16:37 ` Clueless :) Martin Krischik
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