comp.lang.ada
 help / color / mirror / Atom feed
From: bbalfour@std.caci.com (Brad Balfour)
Subject: Re: How to overload assignment in Ada 95?
Date: 1996/12/11
Date: 1996-12-11T00:00:00+00:00	[thread overview]
Message-ID: <bbalfour-1112961514160001@stmac0088.std.caci.com> (raw)
In-Reply-To: JSA.96Dec10161923@alexandria


In article <JSA.96Dec10161923@alexandria>, jsa@alexandria (Jon S Anthony) wrote:

>In article <mheaney-ya023280000912962054110001@news.ni.net>
mheaney@ni.net (Matthew Heaney) writes:
>
>> Does anyone have a rule of thumb for when a controlled type should publicly
>> derive from type Ada.Finalization.Controlled?  For example
[snip] 
>> In the former case, clients of the Unbounded_Stack have direct visibility
>> to the operations Initialize, Finalize, and Adjust.  When is this a good
>> thing?  A bad thing?
>
>"Never" (scare quotes just in case there _might_ be some odd case
>where it would make sense...)

I'd think that a "not so odd" case would be any time that your new
abstraction needed to be used anywhere that any descendent of
Ada.Finalization.Controlled would be expected (i.e., as
Ada.Finalization.Controlled'class). 

This could be via a generic formal parameter (type foo is new
Ada.Finalization.Controlled with private) or via type extension (e.g., a
list whose components are of Ada.Finalization.Controlled'class).

In order to use these, you must be known to be a (visible) extension of
Ada.Finalization.Controlled. A side effect of this is that the three
operations are visible to clients.

Brad

>Jon Anthony
>Organon Motives, Inc.
>Belmont, MA 02178
>617.484.3383
>jsa@organon.com

-- 
Brad Balfour                            SIGAda WWW Server
CACI, Inc.                                http://www.acm.org/sigada/
(703) 277-6767                          and also try:
bbalfour@std.caci.com                     http://www.adahome.com/
3930 Pender Drive     Fairfax, VA 22030
   "...they even have have rules on exceptions" -- Dewar and Schonberg




  reply	other threads:[~1996-12-11  0:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-12-06  0:00 How to overload assignment in Ada 95? Christopher D Carothers
1996-12-07  0:00 ` Robert Dewar
1996-12-09  0:00 ` Brad Balfour
1996-12-09  0:00   ` Matthew Heaney
1996-12-10  0:00     ` Brad Balfour
1996-12-10  0:00       ` Larry Kilgallen
1996-12-11  0:00         ` Brad Balfour
1996-12-11  0:00           ` Larry Kilgallen
     [not found]       ` <01bbe6dc$6feb3620$829d6482@joy.ericsson.se>
1996-12-11  0:00         ` Brad Balfour
1996-12-11  0:00         ` Norman H. Cohen
1996-12-10  0:00     ` Robert A Duff
1996-12-10  0:00 ` Jon S Anthony
1996-12-11  0:00   ` Brad Balfour [this message]
1996-12-13  0:00     ` Robert A Duff
replies disabled

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