comp.lang.ada
 help / color / mirror / Atom feed
From: bdl@mda.ca (Bruce Link)
Subject: Re: Ada 95 visibility question
Date: 1997/09/25
Date: 1997-09-25T00:00:00+00:00	[thread overview]
Message-ID: <60ear5$7hu$1@beauty.mda.ca> (raw)
In-Reply-To: 342A7989.219C@catalina-inter.net


Chris Sparks (Mr. Ada) (mrada@CATALINA-INTER.NET) wrote:
: Robert A Duff <bobduff@WORLD.STD.COM> wrote:
: 
: > >package body c.f is
: > >  procedure p(x:in out file_dialog) is
: > >    y:integer;
: > >  begin
: > >    y:=root(x).peek_a_boo;
: > >    y:=x.peek_a_boo;  1/3 of compilers tested complained
: >
: > This is illegal.  Dialog has a peek_a_boo component implicitly declared
: > in the private part of c.d.  There is no place within the immediate
: > scope of file_dialog where this private part is visible, so file_dialog
: > doesn't declare peek_a_boo.  (It's still there at run time, but you can
: > only get at it by doing a type conversion, as shown above.)
: 
: Wouldn't peek_a_boo be visible since the types are part of the "c" (no
: pun
: intended) hierarchy?
: 
: Chris Sparks
Robert Duff cites 7.3.1 (no paragraph), but this does not seem to apply in
the way he intends it.  7.1(7) says an entity declared in the private part of
a package is visible only within the declarative region of the package
itself (including any child units).  I would say that the construct is legal
(after much chasing around in section 8.1, 7.2, and 10.1.1).  Without the 
legalities, I understood, as Chris, that the contents of the private part 
of a package were visible in the specs of private children, and the private
sections and bodies of all children.

-- 
----------------------------------------------------------------------------
Bruce Link                         |Team OS/2
bdl@mda.ca                         |Team Ada




  reply	other threads:[~1997-09-25  0:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-09-25  0:00 Ada 95 visibility question Chris Sparks (Mr. Ada)
1997-09-25  0:00 ` Bruce Link [this message]
1997-09-25  0:00   ` Tucker Taft
1997-09-26  0:00 ` Robert A Duff
  -- strict thread matches above, loose matches on Subject: below --
1997-09-20  0:00 Tom Moran
1997-09-22  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