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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7112e553a3bbd8d7 X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: Q re static deferred constants Date: 1997/07/17 Message-ID: #1/1 X-Deja-AN: 257864032 References: <33CDB52B.25FE@bix.com> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada Date: 1997-07-17T00:00:00+00:00 List-Id: In article <33CDB52B.25FE@bix.com>, Tom Moran 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