comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Dewar <robert_dewar@my-deja.com>
Subject: Re: Subverting 'Access for Sub-programs
Date: 1999/08/06
Date: 1999-08-06T00:00:00+00:00	[thread overview]
Message-ID: <7oeini$1pb$1@nnrp1.deja.com> (raw)
In-Reply-To: m3iu6tjw2d.fsf@vault83.infomatch.bc.ca

In article <m3iu6tjw2d.fsf@vault83.infomatch.bc.ca>,
  Ray Blaak <blaak@infomatch.com> wrote:
> It is not fundamental and obvious to me. Perhaps you could
> explain.

Well this has been dealt with in length in previous threads,
so it is not appropriate to repeat it, but briefly, an extension
of a tagged type with new overriding primitives clearly
generates the possibility of dispatching to these new
primitives. If you allow extension in a smaller scope, you
can obviously generate dangling pointers for these methods,
using class variables whose value is the inner derived type.
It would thus be unsafe to allow this extension.
>
> I am aware of implementation concerns with allowing such a
> thing, but the restriction seems is an exception to the
> generality of declaring Ada constructs that is usually
> allowed.

It is not an implementation concern, it is trivial to allow
this in an implementation, it is a concern with safety of the
code and avoiding dangling pointers.

Pointers are in general a menace, they are the "gotos" of
data structures. Ada admits them into the language, but only
under the strict rule that if you do not use unchecked features,
then you can never generate a dangling pointer. Dangling
pointers are very dangerous when dealing with nested procedures
because they can lead to undetected and subtle data corruption.

> The current practice of knowing that some things have to be
> defined at the library level is not something that is obvious
> when reading sources, and is something that just seems to be
> part of the Ada lore.

I see no reason to expect that you could learn the rules of
a language simply by reading code. This rule is in fact very
clearly stated in the RM 3.9.1:

3   The parent type of a record extension shall not be a
    class-wide type.  If the parent type is nonlimited, then
    each of the components of the record_extension_part shall
    be nonlimited. The accessibility level (see 3.10.2) of a
    record extension shall not be statically deeper than that
    of its parent type.  In addition to the places where
    Legality Rules normally apply (see 12.3), these rules apply
    also in the private part of an instance of a generic unit.

Seems clear enough, hardly part of the "lore" of Ada unless you
include the rules of the language in the standard. And if you
do, all I can say is where else do you expect to find the rules
of writing Ada except in the book of rules :-)


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.




  parent reply	other threads:[~1999-08-06  0:00 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-08-03  0:00 Subverting 'Access for Sub-programs Anton Gibbs
1999-08-03  0:00 ` Brian Rogoff
1999-08-03  0:00 ` Michael F. Yoder
1999-08-03  0:00 ` David C. Hoos, Sr.
1999-08-05  0:00   ` Robert A Duff
1999-08-03  0:00 ` Ted Dennison
1999-08-03  0:00 ` tmoran
1999-08-03  0:00 ` Steve Doiel
1999-08-04  0:00 ` Anton Gibbs
1999-08-04  0:00   ` Robert A Duff
1999-08-04  0:00     ` Brian Rogoff
1999-08-05  0:00       ` tmoran
1999-08-05  0:00         ` Aidan Skinner
1999-08-05  0:00         ` Robert Dewar
1999-08-05  0:00           ` Ray Blaak
1999-08-06  0:00             ` Jean-Pierre Rosen
1999-08-06  0:00               ` Hyman Rosen
1999-08-07  0:00                 ` Florian Weimer
1999-08-06  0:00             ` Robert Dewar [this message]
1999-08-06  0:00               ` Robert A Duff
1999-08-08  0:00                 ` Brian Rogoff
1999-08-09  0:00                   ` Robert A Duff
1999-08-10  0:00                     ` Brian Rogoff
1999-08-09  0:00                 ` Tucker Taft
1999-08-05  0:00     ` Anton Gibbs
1999-08-04  0:00   ` Jean-Pierre Rosen
1999-08-04  0:00     ` Brian Rogoff
1999-08-05  0:00       ` Jean-Pierre Rosen
1999-08-05  0:00         ` Robert A Duff
1999-08-05  0:00           ` tmoran
1999-08-06  0:00             ` Robert A Duff
1999-08-05  0:00           ` Brian Rogoff
1999-08-06  0:00             ` Robert Dewar
1999-08-09  0:00               ` Tucker Taft
1999-08-10  0:00                 ` Robert Dewar
1999-08-11  0:00                   ` Dmitry A. Kazakov
1999-08-11  0:00                     ` Richard D Riehle
1999-08-11  0:00                     ` Robert Dewar
1999-08-12  0:00                       ` Dmitry A. Kazakov
1999-08-14  0:00                         ` Robert Dewar
1999-08-16  0:00                           ` Dmitry A. Kazakov
1999-08-11  0:00                   ` Tucker Taft
1999-08-13  0:00                     ` Robert Dewar
1999-08-13  0:00                       ` Brian Rogoff
1999-08-13  0:00                     ` Robert Dewar
1999-08-11  0:00                   ` Robert A Duff
1999-08-11  0:00                     ` Robert Dewar
1999-08-05  0:00           ` Robert Dewar
1999-08-05  0:00         ` adam
1999-08-05  0:00           ` Robert Dewar
1999-08-05  0:00             ` What is a Display ? (was: Subverting 'Access for Sub-programs) Larry Kilgallen
1999-08-05  0:00               ` Hyman Rosen
1999-08-06  0:00                 ` Robert Dewar
1999-08-06  0:00               ` Robert Dewar
1999-08-05  0:00           ` Subverting 'Access for Sub-programs adam
1999-08-06  0:00             ` Robert A Duff
1999-08-06  0:00               ` adam
1999-08-09  0:00                 ` Robert A Duff
1999-08-09  0:00                 ` Mark Biggar
1999-08-06  0:00         ` Brian Rogoff
1999-08-07  0:00           ` Gautier
1999-08-05  0:00     ` Robert A Duff
1999-08-05  0:00       ` Robert Dewar
1999-08-05  0:00         ` Brian Rogoff
1999-08-05  0:00   ` Steve Quinlan
1999-08-04  0:00 ` Robert Dewar
1999-08-04  0:00   ` Robert A Duff
1999-08-04  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