From: bobduff@world.std.com (Robert A Duff)
Subject: Re: Q re static deferred constants
Date: 1997/07/17
Date: 1997-07-17T00:00:00+00:00 [thread overview]
Message-ID: <EDGwun.KKM@world.std.com> (raw)
In-Reply-To: 33CDB52B.25FE@bix.com
In article <33CDB52B.25FE@bix.com>, Tom Moran <tmoran@bix.com> wrote:
>Given:
>package p is
> type T is new Integer;
> x : constant T;
>private
> x : constant T := 1;
>
>Is p.x static? ie, can another package use p.x for a 'when' in a case
>statement?
No.
If X were static, then this would constitute a violation of privacy. It
should not be possible to make a modification to a private part that
causes clients to become illegal. If X were static, then such
modifications would be possible.
On the other hand, inside the package body, or anywhere else where that
private part is visible (child packages) X is of course static.
A good compiler will take advantage of the compile-time-known value 1,
despite the fact that X is not static (when viewed from outside). But
that's a code-generation issue, not a legality issue.
- Bob
next prev parent reply other threads:[~1997-07-17 0:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
1997-07-16 0:00 Q re static deferred constants Tom Moran
1997-07-17 0:00 ` Robert A Duff [this message]
1997-07-17 0:00 ` Tucker Taft
1997-07-19 0:00 ` Tom Moran
1997-07-20 0:00 ` Tucker Taft
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox