comp.lang.ada
 help / color / mirror / Atom feed
From: stt@houdini.camb.inmet.com (Tucker Taft)
Subject: Re: GNAT controlled types
Date: 1998/01/28
Date: 1998-01-28T00:00:00+00:00	[thread overview]
Message-ID: <EnH6KM.L2I.0.-s@inmet.camb.inmet.com> (raw)
In-Reply-To: 01bd2b67$04bf1760$79f482c1@xhv46.dial.pipex.com


Nick Roberts (Nick.Roberts@dial.pipex.com) wrote:

: Many thanks for the comprehensive reply.  I had forgotten that the rule
: applies wholesale to tagged types (as it sensibly must).

: I have to say, with the benefit of hindsight, it might have been a better
: decision to implement controlled types in a different way.  I feel sure
: that -- by means of inlining -- undue performance penalties could be
: avoided.  It is surely inconvenient, at times, not to be able to control
: non-tagged types.  This ability may have been considered 'dangerous' or
: unnecessary by the committee, but wrongly IMHO!

Any kind of record or array may have controlled components.  I highly
recommend that you make individual components "clean up" after
themselves rather than relying on the root type being controlled.

By the way, Ada 95 was not designed by a committee.  It was designed by a 
design team, and reviewed by Ada experts throughout the international
Ada community.

The decision to base controlled types on type extension was an attempt
to ensure a relatively straightforward implementation, where the
root controlled type would contain links for inserting the controlled
object on a linked list.  Ultimately, other considerations (such as
"mutable" discriminated types) pushed us to abandon the 
links-through-the-object implementation model in our Ada 95 front end,
but I believe other compilers have taken advantage of the type
extension approach.

: Nick Roberts
: Croydon, UK

: Proprietor, ThoughtWing Software; Independent Software Development
: Consultant
: * Nick.Roberts@dial.pipex.com * Voicemail & Fax +44 181-405 1124 *

--
-Tucker Taft   stt@inmet.com   http://www.inmet.com/~stt/
Intermetrics, Inc.  Burlington, MA  USA




  reply	other threads:[~1998-01-28  0:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-01-25  0:00 GNAT errormessage question Haug Buerger
     [not found] ` <EnCrzw.EHw@world.std.com>
1998-01-26  0:00   ` GNAT controlled types Nick Roberts
1998-01-26  0:00     ` Jon S Anthony
     [not found]     ` <EnEu4B.6rr@world.std.com>
1998-01-27  0:00       ` Nick Roberts
1998-01-28  0:00         ` Tucker Taft [this message]
1998-01-28  0:00           ` Brian Rogoff
1998-01-29  0:00             ` Tucker Taft
1998-02-01  0:00               ` Robert Dewar
replies disabled

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