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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,704a2a0ee079967 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-08-25 11:26:38 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!headwall.stanford.edu!news-out.nibble.net!news-in.nibble.net!newsfeed.direct.ca!look.ca!newsfeed1.earthlink.net!newsfeed.earthlink.net!newsmaster1.prod.itd.earthlink.net!newsread2.prod.itd.earthlink.net.POSTED!not-for-mail Message-ID: <3B87EDC9.A6D626E8@acm.org> From: Jeffrey Carter X-Mailer: Mozilla 4.7 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Using renaming declarations to make private subprograms visible References: <87itfcnuyj.fsf@chiark.greenend.org.uk> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Sat, 25 Aug 2001 18:27:02 GMT NNTP-Posting-Host: 209.86.208.29 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.prod.itd.earthlink.net 998764022 209.86.208.29 (Sat, 25 Aug 2001 11:27:02 PDT) NNTP-Posting-Date: Sat, 25 Aug 2001 11:27:02 PDT Organization: EarthLink Inc. -- http://www.EarthLink.net X-Received-Date: Sat, 25 Aug 2001 11:23:37 PDT (newsmaster1.prod.itd.earthlink.net) Xref: archiver1.google.com comp.lang.ada:12417 Date: 2001-08-25T18:27:02+00:00 List-Id: Matthew Woodcraft wrote: > > Now suppose that (for the moment), I want to implement this type using > an unbounded string. I can make Token_Type a derived type of > Unbounded_String, and use renaming declarations to make some of the > 'inherited' subprograms publicly visible: > > private > > type Token_Type is new Ada.Strings.Unbounded.Unbounded_String; > > function To_Token (Source : String) return Token_Type > renames To_Unbounded_String; > > -- No good > function To_String (Source : Token_Type) return String > renames To_String; This compiles with GNAT 3.13p: function Convert_To_String (Source : Token_Type) return String renames To_String; function To_String (Source : Token_Type) return String renames Convert_To_String; -- Jeff Carter "I wave my private parts at your aunties." Monty Python & the Holy Grail