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 X-Google-Attributes: gid103376,public From: nospam@thanks.com.au (Don Harrison) Subject: Re: Can't export object of private type Date: 1999/02/26 Message-ID: #1/1 X-Deja-AN: 448627742 Sender: news@syd.csa.com.au X-Nntp-Posting-Host: dev7 References: <7b47m3$l2l$1@remarQ.com> Organization: CSC Australia, Sydney Reply-To: nospam@thanks.com.au Newsgroups: comp.lang.ada Date: 1999-02-26T00:00:00+00:00 List-Id: Fraser wrote: :paene lacrimavi postquam nospam@thanks.com.au scribavit: : :>Actually, I don't necessarily want to do that. What I'm really after :>is polymorphic singletons - objects that :> :> 1) Have only one instance :> 2) Are polymorphic :> 3) Are visible to clients :> 4) Can be called without a package prefix. : :What about a parameterless function that returns that type? This seems closest to what I'm after so far. The possible weaknesses are: 1) Having to prefix them with package names to disambiguate specific derivations: .. := T.Solo; .. := T.Child.Solo; (I'm attempting to avoid package prefixes altogether, but perhaps this is a vain hope). 2) Having to retain the same function name even though derivations require more specific names. Maybe renaming could help here.. :The only :down side being that you'd have to override it for each extension. :Or maybe that's not a down side, depending on what you want to do. Right - I *do* want to override. [Fraser's example] :>:> procedure Do_Something (S: in Singleton_Type); : :What about "procedure Do_Something (S : access Singleton_Type)", to :avoid a bunch of S.all's everywhere. Good idea. :I just love the way Ada compilers fill in .all for me. Can you give an example? -- Don (Harrison). donh at syd.csa.com.au