comp.lang.ada
 help / color / mirror / Atom feed
From: bobduff@world.std.com (Robert A Duff)
Subject: Re: Primitive Operations Question
Date: 1996/08/01
Date: 1996-08-01T00:00:00+00:00	[thread overview]
Message-ID: <DvGqsu.K1n@world.std.com> (raw)
In-Reply-To: 31FFBFC8.32C9@ix.netcom.com


In article <31FFBFC8.32C9@ix.netcom.com>,
Vance Christiaanse  <cintech@ix.netcom.com> wrote:
>> Strange.  The word "tagged" appears nowhere in the definition in of
>> "primitive subprogram" in 3.2.3, so it shouldn't make any difference.
>> 
>> - Bob
>
>Well, type extension of a tagged type in a procedure _could_ lead to
>dangling references (see Rationale 4.3, package Outer).  I suspect
>that's why a compiler would be more careful to prevent it.

Umm, you can only create dangling refs if the derived type is more
nested than the parent type.  And this is illegal -- that's a language
rule, and has nothing to do with a particular compiler being careful.
It also has nothing to do with which subprograms are primitive.  See the
"accessibility rules".

On the other hand, it's perfectly legal to declare a root tagged type in
a procedure, and derive from it in the same procedure.  And this can't
cause dangling refs.  Of course, if you want any primitive ops, you will
need to nest packages within that procedure.  This is probably not
common -- *most* tagged types will be declared at library level.

- Bob




  reply	other threads:[~1996-08-01  0:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-07-30  0:00 Primitive Operations Question Vance Christiaanse
1996-07-31  0:00 ` Tucker Taft
1996-07-31  0:00 ` Samuel Tardieu
1996-07-31  0:00 ` Robert A Duff
1996-07-31  0:00   ` Vance Christiaanse
1996-08-01  0:00     ` Robert A Duff [this message]
1996-08-01  0:00       ` Vance Christiaanse
1996-07-31  0:00 ` Jon S Anthony
1996-08-01  0:00 ` Jon S Anthony
1996-08-01  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