Version 1.1 of acs/ac-00079.txt

Unformatted version of acs/ac-00079.txt version 1.1
Other versions for file acs/ac-00079.txt

!standard 7.03(02)          03-09-16 AC95-00079/01
!class amendment 03-09-16
!status received no action 03-09-16
!status received 03-09-11
!subject Aliased views
!summary
!appendix

From: Matthew Heaney
Sent: Thursday, September 11, 2003  12:52 PM

If I have this:

  procedure Op (O : access T);

and I try to do this:

  procedure Op2 (O : in out T) is
  begin
     Op (O'Access);
  end;

then I don't think this will compile, unless Op2.O is an aliased view of T.

You get an aliased view of T if the type is tagged, even the partial view:

package P is

   type T is tagged private;
prvate
   type T is tagged null record;
end;

So Op2 should compile.

My problem is this.  Suppose the partial view of T is untagged, but the full is tagged:

package Q is
   type T is private;
private
   type T is tagged null record;
end;

I can't compile Op2 anymore, because I don't have an aliased view of Q.T, even though Q.T really is tagged.

Is there any interest is liberalizing the language so that I can get an aliased view of Q.T, if the full view is tagged but the partial view isn't?

Or what about marking the partial view somehow, so that it makes a promise about how the full view is implemented, e.g.

package Q2 is
   type T is aliased private;
private
   type T is tagged null record;
end;

This would even work for limited types, which would require that the full view itself be limited (or at least pass-by-reference):

package R is
   type T is aliased limited private;
private
   type T is limited null record;
end;

****************************************************************

From: Tucker Taft
Sent: Thursday, September 11, 2003  1:48 PM

This is an interesting idea.
You would want to allow it on full types as well, I believe,
with the semantics that the type becomes a pass-by-reference
type, and all objects of the type are aliased.

It would only be permitted on full types that allow pass-by-reference,
presumably, i.e., only on composite types.

****************************************************************

From: Matthew Heaney
Sent: Thursday, September 11, 2003   2:06 PM

I was thinking only about the partial view of the type, but I like your idea.

I means I can have a record that is pass-by-reference, non-limited, non-tagged,
and has an aliased view.  That would be ideal.


> It would only be permitted on full types that allow pass-by-reference,
> presumably, i.e., only on composite types.

Yes.  That's OK.

****************************************************************

Questions? Ask the ACAA Technical Agent