From: "Robert I. Eachus" <rieachus@comcast.net>
Subject: Re: Deallocation & Tagged Types
Date: Mon, 20 Oct 2003 01:08:32 GMT
Date: 2003-10-20T01:08:32+00:00 [thread overview]
Message-ID: <3F933577.9030104@comcast.net> (raw)
In-Reply-To: 8ezkb.5981$mM1.925@newsfep4-winn.server.ntli.net
chris wrote:
> I tried instantiating Unchecked_Deallocation on Vehicle and not
> Vehicle'Class not knowing you could do that.
Sigh, I should have tried harder to get that notation fixed in Ada 83.
Most of the time the Object name in an instantiation of
Unchecked_Deallocation is a dummy parameter.
Yes, there are cases where the size of the object being deallocated
cannot be determined from the access type name, and the subtype of the
Object type can be used by the compiler. But that only argues that
there should be two versions of Unchecked_Deallocation, and the compiler
should reject the one parameter version at compile time if it does need
to use the designated subtype information. But that would IMHO be
better than allowing users to instantiate with the "wrong" constrained
subtype thinking it doesn't matter.
Requiring the user to provide the "right" subtype when it doesn't
matter--except that the compiler can reject a wrong value--is one of
those "little tests" that Tucker used to talk about.
> Yes the ADT abstraction was broken, but only after trying to get
> around the problem of deallocating the access component in the
> record. The ugliness is (IMO) gone now.
It sounds like you are still doing more than you really have to. But I
don't know understand your full design well enough to understand whether
the explicit allocation and deallocation are necessary.
But I assume that your "Proxy" notation indicates that you do need to
use a pointer to the object rather than copying the object.
--
Robert I. Eachus
"Quality is the Buddha. Quality is scientific reality. Quality is the
goal of Art. It remains to work these concepts into a practical,
down-to-earth context, and for this there is nothing more practical or
down-to-earth than what I have been talking about all along...the repair
of an old motorcycle." -- from Zen and the Art of Motorcycle
Maintenance by Robert Pirsig
next prev parent reply other threads:[~2003-10-20 1:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-10-18 20:53 Deallocation & Tagged Types chris
2003-10-19 15:38 ` Robert I. Eachus
2003-10-19 16:53 ` chris
2003-10-20 1:08 ` Robert I. Eachus [this message]
2003-10-19 16:10 ` Dmitry A. Kazakov
2003-10-19 16:50 ` chris
2003-10-20 1:13 ` Robert I. Eachus
2003-10-20 1:43 ` Hyman Rosen
2003-10-26 8:11 ` Patrice Freydiere
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox