comp.lang.ada
 help / color / mirror / Atom feed
From: Tim Rowe <spamtrap@tgrowe.plus.net>
To: "Alex R. Mosteo" <alejandro@mosteo.com>
Subject: Re: Newbie question -- dereferencing access
Date: Fri, 13 Mar 2009 16:31:19 +0000
Date: 2009-03-13T16:31:19+00:00	[thread overview]
Message-ID: <49BA8A57.7090200@tgrowe.plus.net> (raw)
In-Reply-To: <71ut2oFn4m2pU1@mid.individual.net>

Alex R. Mosteo wrote:

> While these are certainly important skills, one thing you should notice when 
> transitioning to Ada is a decreased need for access types thanks to 
> unconstrained/indefinite types. I'd think that would mean that you're in the 
> right track.

But I can't put an unconstrained type into a record. I realise that I 
can make the record discriminated and constrain the type on the 
discriminant, trying to write a class that gives strtok-like 
functionality -- the excercise I have set myself at the moment -- means 
that I discover the sizes of relevant strings rather late in the game.

> Anyway, if you have a sound knowledge of memory management in C/C++, it's 
> pretty much the same. Don't forget to deallocate, wrap it all in a 
> controlled type.

What I'm feeling the lack of is destructors for classes (sorry, for 
tagged records). I suspect I'll find what I need when I learn about 
finalizers, but whereas in C++ I learned about delete at the same time 
as I learned about new, and I learned about destructors at the same time 
as I learned about constructors, it seems strange in Ada to find access 
allocation addressed in the mainstream and access deallocation relegated 
to an advanced topic (and destructors nowhere in my sight). And yet it's 
C/C++ that has the reputation for memory leaks!



  reply	other threads:[~2009-03-13 16:31 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-11 20:26 Newbie question -- dereferencing access Tim Rowe
2009-03-11 20:46 ` Ludovic Brenta
2009-03-12  9:57   ` Tim Rowe
2009-03-12 10:16     ` Ludovic Brenta
2009-03-12 13:24       ` Tim Rowe
2009-03-12 12:13     ` christoph.grein
2009-03-12 13:00       ` Tim Rowe
2009-03-12 13:30       ` Ed Falis
2009-03-13  9:55         ` Tim Rowe
2009-03-13 11:06           ` Alex R. Mosteo
2009-03-13 16:31             ` Tim Rowe [this message]
2009-03-13 16:52               ` Georg Bauhaus
2009-03-13 17:31                 ` Tim Rowe
2009-03-13 18:18                   ` Tim Rowe
2009-03-13 18:27                     ` Pascal Obry
2009-03-13 18:46                     ` Niklas Holsti
2009-03-13 21:38                       ` Tim Rowe
2009-03-13 22:28                         ` Per Sandberg
2009-03-13 16:52               ` Tim Rowe
2009-03-13 17:33               ` Martin
2009-03-14  7:30                 ` sjw
2009-03-14  7:45                   ` sjw
2009-03-14  9:21                   ` Martin
2009-03-23  8:43                     ` Martin
2009-03-16  8:30               ` Alex R. Mosteo
2009-03-13 16:50             ` Tim Rowe
2009-03-13 16:19           ` Martin
2009-03-12 16:43     ` qunying
2009-03-12 18:21     ` Ivan Levashew
2009-03-13  5:59       ` christoph.grein
replies disabled

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