comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <spam@spam.com>
Subject: Re: Protected types private part visibility , helpfull hints needed.
Date: Fri, 29 Apr 2005 03:03:36 GMT
Date: 2005-04-29T03:03:36+00:00	[thread overview]
Message-ID: <cuhce.943$HL2.746@newsread3.news.pas.earthlink.net> (raw)
In-Reply-To: <mailman.97.1114687832.24457.comp.lang.ada@ada-france.org>

You're quite right: any types referenced in the private part of the 
protected type must be publicly visible in the enclosing package spec. 
I'm not sure if the "private with" of Ada 0X will apply in this case; I 
recall that it only allows references in the private part of the package.

FWIW, the following compiles:

package Private_Protected_Private is
    type Implementation is limited private;

    protected type Pt is
       procedure Op (I : in Integer);
    private -- Pt
       Value : Implementation;
    end Pt;
private -- Private_Protected_Private
    type Implementation is ...;
end Private_Protected_Private;

This allows the types used in the private part of the protected type to 
be private to clients of the package.

-- 
Jeff Carter
"Beyond 100,000 lines of code you
should probably be coding in Ada."
P. J. Plauger
26



  parent reply	other threads:[~2005-04-29  3:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20050428025529.717ED4C40D8@lovelace.ada-france.org>
2005-04-28 11:30 ` Protected types private part visibility , helpfull hints needed Christopher Gosset
2005-04-28 12:16   ` Dmitry A. Kazakov
2005-04-29  3:03   ` Jeffrey Carter [this message]
     [not found] <000101c54be5$a4aad420$9500000a@amd2600>
2005-04-29  1:22 ` Stephen Leake
replies disabled

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