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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,9081ae7069434ca5 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.73.229 with SMTP id o5mr1410707pbv.7.1328794949663; Thu, 09 Feb 2012 05:42:29 -0800 (PST) Path: wr5ni5032pbc.0!nntp.google.com!news2.google.com!news.glorb.com!feeder.erje.net!news.mixmin.net!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Publishing selected entries in a protected object? Date: Thu, 9 Feb 2012 14:42:19 +0100 Organization: cbb software GmbH Message-ID: <1aa4khpoo56jh$.7pxzenl1ikpa.dlg@40tude.net> References: <87wr7wkyp5.fsf@adaheads.sparre-andersen.dk> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: FbOMkhMtVLVmu7IwBnt1tw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2012-02-09T14:42:19+01:00 List-Id: On Thu, 09 Feb 2012 12:56:06 +0100, Jacob Sparre Andersen wrote: > I have a package containing a protected object, and I would like to > publish _one_ of this object's entries in the specification of the > package. > > Since I want to be able to use the entry in a select statement, I can't > just encapsulate it in a procedure and make that available in the > package specification. > > And if I move the declaration of the protected object to the package > specification, but move the other entries to the private part of the > protected object, I can't access the other entries from the private part > of my package. > > Is there a pattern I can use? Not exactly, but ... type I is protected interface; procedure A (X : in out I) is abstract; protected type Foo is new I with overriding entry A; -- "Public entry" entry B; -- "Private entry" end Foo; Now, if only the interface I is visible, then that would be close to what you wanted. P.S. Alas, but the following is illegal: [protected] type Foo is new I with private; private protected type Foo is new I with ... end Foo; -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de