comp.lang.ada
 help / color / mirror / Atom feed
* Re: Record rep specs for private components
@ 1989-06-18 14:30 Edward Berard
  1989-06-20 13:06 ` Joe Orost
  0 siblings, 1 reply; 6+ messages in thread
From: Edward Berard @ 1989-06-18 14:30 UTC (permalink / raw)


I have a problem with the following:

>   package a is
>      type aa is private;
>   private
>      type aa is range 0..1000;
>   end a;
>
>   with a;
>   package b is
>      type bb is record
>         bbb : a.aa;
>      end record;
>      for bb use record
>        at mod 2;
>        bbb at 0 range 0..15;       --Legal?
>      end record;
>      x : bb;
>   end b;

If type a.aa is private, then its underlying implementation should be
unknown outside of package a. This means that it should be impossible
for another program unit to specify how much space an instance of this
type should take up. [Of course, package a could supply operations
which could provide alternative representations of known sizes, and
these could be used in other program units.]

In short, if the rep spec is legal Ada, it should not be, and should
be fixed in Ada 9X.

				-- Ed Berard
				   (301) 353-9652

^ permalink raw reply	[flat|nested] 6+ messages in thread
* Record rep specs for private components
@ 1989-06-10  0:16 Joe Orost
  1989-06-17 16:43 ` Joe Orost
  0 siblings, 1 reply; 6+ messages in thread
From: Joe Orost @ 1989-06-10  0:16 UTC (permalink / raw)


We're having a discussion within the posix-ada group about the legality of
record rep-specs for record components of a private type.  I want to find
out what current compilers accept.  Can a few of you try this on various Ada 
compilers (Don't bother if you have VERDIX or SYSTEAM; I tried those):

   package a is
      type aa is private;
   private
      type aa is range 0..1000;
   end a;

   with a;
   package b is
      type bb is record
         bbb : a.aa;
      end record;
      for bb use record
        at mod 2;
        bbb at 0 range 0..15;       --Legal?
      end record;
      x : bb;
   end b;

Please send mail.  I will summarize to the net.

				regards,
				joe

--

 Full-Name:  Joseph M. Orost
 UUCP:       rutgers!petsd!joe
 ARPA:	     petsd!joe@RUTGERS.EDU, joe@petsd.ccur.com
 Phone:      (201) 758-7284
 US Mail:    MS 313; Concurrent Computer Corporation; 106 Apple St
             Tinton Falls, NJ 07724

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~1989-06-24 16:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1989-06-18 14:30 Record rep specs for private components Edward Berard
1989-06-20 13:06 ` Joe Orost
1989-06-23 19:57   ` Goodenough
1989-06-24 16:30     ` Edward Berard
  -- strict thread matches above, loose matches on Subject: below --
1989-06-10  0:16 Joe Orost
1989-06-17 16:43 ` Joe Orost

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