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,bd913e780983783a X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-08-28 21:18:34 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.direct.ca!look.ca!newshub2.rdc1.sfba.home.com!news.home.com!news1.sttln1.wa.home.com.POSTED!not-for-mail From: "DuckE" Newsgroups: comp.lang.ada References: <878zg3vma6.fsf@chiark.greenend.org.uk> Subject: Re: Using renaming declarations to make private subprograms visib le X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Message-ID: Date: Wed, 29 Aug 2001 04:18:33 GMT NNTP-Posting-Host: 24.248.45.203 X-Complaints-To: abuse@home.net X-Trace: news1.sttln1.wa.home.com 999058713 24.248.45.203 (Tue, 28 Aug 2001 21:18:33 PDT) NNTP-Posting-Date: Tue, 28 Aug 2001 21:18:33 PDT Organization: Excite@Home - The Leader in Broadband http://home.com/faster Xref: archiver1.google.com comp.lang.ada:12544 Date: 2001-08-29T04:18:33+00:00 List-Id: Do you have a problem with creating a body for the package to do the conversion? with Ada.Strings.Unbounded; package tokens is type Token_Type is private; function To_Token(Source: String) return Token_Type; pragma Inline( To_Token ); private type Token_Type is new Ada.Strings.Unbounded.Unbounded_String; end; package body tokens is function To_Token (Source: String) return Token_Type is begin return Token_Type( Ada.Strings.Unbounded.To_Unbounded_String(Source) ); end To_Token; end tokens; It may be a little verbose, but should work just fine (I didn't run it to verify, but it compiles). SteveD "Matthew Woodcraft" wrote in message news:878zg3vma6.fsf@chiark.greenend.org.uk... > "Beard, Frank" writes: > > > Matthew, > > > > Have you tried fully qualified names, such as: > > > > private > > > > type Token_Type is new Ada.Strings.Unbounded.Unbounded_String; > > > > function To_Token (Source : String) return Token_Type > > renames Ada.Strings.Unbounded.To_Unbounded_String; > > > > function To_String (Source : Token_Type) return String > > renames Ada.Strings.Unbounded.To_String; > > But Ada.String.Unbounded.To_String is a function which return an > Ada.Strings.Unbounded.Unbounded_String. The function which I want to > make visible is its implicitly-defined cousin, which returns a Token. > > -M- >