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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!sri-spam!mordor!lll-tis!ames!ucbcad!ucbvax!TL-20B.ARPA!Evans From: Evans@TL-20B.ARPA ("Art Evans") Newsgroups: comp.lang.ada Subject: renaming types Message-ID: <8706270326.AA26169@ucbvax.Berkeley.EDU> Date: Fri, 26-Jun-87 13:28:28 EDT Article-I.D.: ucbvax.8706270326.AA26169 Posted: Fri Jun 26 13:28:28 1987 Date-Received: Sat, 27-Jun-87 14:03:33 EDT Sender: daemon@ucbvax.BERKELEY.EDU Distribution: world Organization: The ARPA Internet List-Id: Ada does not permit renaming types, the syntax in ARM 8.5 not including any way to do so. In general, the rationale for this lack is that a subtype declaration can be used instead. However, using a subtype does not work in all cases. What I want is something like this: with B; -- Package exporting a type. package A is type T is private; -- A private type. ... private type T renames B.BT; -- Illegal! end A; The renaming declaration is of course illegal. Moreover, the subtype mechanism doesn't help, since there's no such thing as a 'private subtype' declaration and a private type may not be completed with a subtype. I see no clean way out of this problem. The problem can be solved (sort of) by completing the private type declaration with either of type T is record F: B.BT; end record; or type T is access B.BT; I find both of these to be pretty ugly. Either affects all code that uses objects of the type. Has anyone a better solution? This matter looks like a candidate for consideration when Ada is next revised. Art Evans Tartan Labs -------