comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <jrcarter@acm.org>
Subject: Re: Using renaming declarations to make private subprograms visible
Date: Sat, 25 Aug 2001 18:27:02 GMT
Date: 2001-08-25T18:27:02+00:00	[thread overview]
Message-ID: <3B87EDC9.A6D626E8@acm.org> (raw)
In-Reply-To: 87itfcnuyj.fsf@chiark.greenend.org.uk

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



  reply	other threads:[~2001-08-25 18:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-25 13:13 Using renaming declarations to make private subprograms visible Matthew Woodcraft
2001-08-25 18:27 ` Jeffrey Carter [this message]
2001-08-26 10:59   ` Matthew Woodcraft
2001-08-26 12:29     ` Marc A. Criley
2001-08-27  5:31     ` Jeffrey Carter
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox