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,b47b15fda2aeb0b2 X-Google-Attributes: gid103376,public From: eachus@spectre.mitre.org (Robert I. Eachus) Subject: Re: Two ideas for the next Ada Standard Date: 1996/09/10 Message-ID: #1/1 X-Deja-AN: 179782542 distribution: world references: <50aao3$3r88@news-s01.ny.us.ibm.net> <50gelc$2le@goanna.cs.rmit.edu.au> organization: The Mitre Corp., Bedford, MA. newsgroups: comp.lang.ada Date: 1996-09-10T00:00:00+00:00 List-Id: In article <513vo7$g9b@watnews1.watson.ibm.com> ncohen@watson.ibm.com (Norman H. Cohen) writes: > However, a subprogram renaming declaration is allowed to serve as the > completion of a declaration, and can rename an enumeration literal, so > you can do the following: > package Foo is > type T is private; > function X return T; > function Z return T; > private > type T is (X_Value, Y_Value, Z_Value, W_Value); > function X return T renames X_Value; > function Z return T renames Z_Value; > end Foo; > (I gave the literals different names from the functions so that both > could be declared in the same package specification.) Why not: package Foo is type T is private; function X return T; function Z return T; private package Bar is type Hidden is (X, Y, Z, W); end Bar; type T is new Bar.Hidden; function X return T is begin return T(Bar.X); end X; function Z return T is begin return T(Bar.Z); end Z; pragma Inline(X,Z); end Foo; Yes, I know that what he really wants is Discard_Names... -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...