comp.lang.ada
 help / color / mirror / Atom feed
* Clueless :)
@ 2003-03-18 12:55 Karel Miklav
  2003-03-18 16:37 ` Martin Krischik
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Karel Miklav @ 2003-03-18 12:55 UTC (permalink / 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




^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2003-03-21 18:01 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-18 12:55 Clueless :) Karel Miklav
2003-03-18 16:37 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox