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.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!gandalf.srv.welterde.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: A non-primitive operation Date: Wed, 15 Nov 2017 16:37:13 -0600 Organization: JSA Research & Innovation Message-ID: References: Injection-Date: Wed, 15 Nov 2017 22:37:14 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="17237"; mail-complaints-to="news@jacob-sparre.dk" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 Xref: feeder.eternal-september.org comp.lang.ada:48920 Date: 2017-11-15T16:37:13-06:00 List-Id: A nested package is the usual way to do this, for the reasons that you stated. Usually, the only routines that make sense to be treated that way are constructor functions (and even those may be better off being primitive, so that the generic dispatching constructor [or "factory"] can be used). Randy. "Victor Porton" wrote in message news:oufm3f$1s0q$1@gioia.aioe.org... >I want a function F which returns a tagged type NOT to be considered as a > primitive operation of T. > > Is there any other way for this, except to declare F in a separate > package? > > What about creating F in a subpackage? This way it could have access to > full > view of T if T is private (an awful hack?): > > package X is > > type T is tagged private; > > package Sub is > function F return T; > end Sub; > > end X; > > Are there other ways? > > -- > Victor Porton - http://portonvictor.org