From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: A non-primitive operation
Date: Wed, 15 Nov 2017 16:37:13 -0600
Date: 2017-11-15T16:37:13-06:00 [thread overview]
Message-ID: <ouifiq$gql$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: oufm3f$1s0q$1@gioia.aioe.org
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" <porton@narod.ru> 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
prev parent reply other threads:[~2017-11-15 22:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-14 19:44 A non-primitive operation Victor Porton
2017-11-14 21:56 ` Dmitry A. Kazakov
2017-11-15 22:37 ` Randy Brukardt [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox