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,83a22b00dc8daff3 X-Google-Attributes: gid103376,public From: Ray Blaak Subject: Re: Generic Instances Scope control ??? Date: 2000/02/22 Message-ID: #1/1 X-Deja-AN: 588691195 Sender: blaak@ns52.infomatch.bc.ca References: X-Trace: news.bc.tac.net 951280856 207.34.170.116 (Tue, 22 Feb 2000 20:40:56 PST) NNTP-Posting-Date: Tue, 22 Feb 2000 20:40:56 PST Newsgroups: comp.lang.ada X-Complaints-To: news@bctel.net Date: 2000-02-22T00:00:00+00:00 List-Id: "Vladimir Olensky" writes: > procedure tst_Gen is > > c1 : Controller_Type; > procedure c1_stat is new GStat (Controller => c1); > --> want to hide c1_stat from client [...] > begin > > Register_Callback (c1, c1_stat'Unrestricted_Access); > --> want to hide Register_Callback from client [...] Just do the instantiation and registeration in another package; no scope operator is needed: with G; use G; generic Controller : in out Controller_Type; package Register_GStat is end Register_GStat package body Register_GStat is procedure Stat is new GStat (Controller => Controller); begin Register_Callback (Controller, Stat'Unrestricted_Access); end Register_GStat; and then: procedure tst_Gen is c1 : Controller_Type; package c1_stat is new Register_GStat (Controller => c1); begin -- Register_Callback is already called by this point. ... end test_Gen; -- Cheers, The Rhythm is around me, The Rhythm has control. Ray Blaak The Rhythm is inside me, blaak@infomatch.com The Rhythm has my soul.