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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,772ae8afc5db35f2,start X-Google-Attributes: gid103376,public From: nospam@thanks.com.au (Don Harrison) Subject: Re: Can't export object of private type Date: 1999/02/24 Message-ID: #1/1 X-Deja-AN: 447798560 Sender: news@syd.csa.com.au X-Nntp-Posting-Host: dev7 References: Organization: CSC Australia, Sydney Reply-To: nospam@thanks.com.au Newsgroups: comp.lang.ada Date: 1999-02-24T00:00:00+00:00 List-Id: Looks like everyone's a bit coy on this question. :) The best workaround I've been able to come up with is to export an access variable to the singleton. For example, package Singleton is type Singleton_Type is tagged private; type Access_Singleton_Type is access all Singleton_Type'Class; procedure Do_Something (S: in Singleton_Type); S_Ptr: Access_Singleton_Type; private type Singleton_Type is tagged null record; S: aliased Singleton_Type; end; initialising the access variable at elaboration .. S_Ptr := S.all'Access; and using it in clients .. Do_Something (S_Ptr.all); Any better suggestions? .. (Of course, it would be easier if Ada just allowed you to export a variable of a private type from the same package. :) Oh, well. -- Don (Harrison). donh at syd.csa.com.au