From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,68448d6fdcce63ae X-Google-Attributes: gid103376,public From: Robert A Duff Subject: Re: Protected Objects: Scoping problem. Date: 1998/06/17 Message-ID: #1/1 X-Deja-AN: 363643011 Sender: bobduff@world.std.com (Robert A Duff) References: <6m3kj4$ev0@nntp02.primenet.com> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada Date: 1998-06-17T00:00:00+00:00 List-Id: Stephen Leake writes: > package Protected_Variable is > > type T is new integer; > > protected Variable is > function Read return T; > > private > procedure Write(Value: T); -- NOT accessible to outside packages True, but I think the original poster wanted Write to be accessible to *this* package (in the body), but not accessible to outside packages. The above doesn't do that. Another post showed how to wrap the call to the protected Read in a normal procedure, and put the whole protected type in the package body. That works, but if the exported thing was an entry, then it wouldn't -- outsiders wouldn't be able to do entry-ish things to it, such as requeue to it, do a timed call to it, &c. -- Change robert to bob to get my real email address. Sorry. -- Change robert to bob to get my real email address. Sorry.