comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <jrcarter@computer.org>
Subject: Re: Hiding a type
Date: Sun, 07 Jul 2002 17:15:02 GMT
Date: 2002-07-07T17:15:02+00:00	[thread overview]
Message-ID: <3D287712.1206C06D@computer.org> (raw)
In-Reply-To: x7vd6tziy2c.fsf@pushface.org

Simon Wright wrote:
> 
> "Frank J. Lhota" <NOSPAM.FrankLho@rcn.com> writes:
> 
> > package Test is
> >      type Public_Name is limited private;
> >      function Initialize( File_Name : String ) return Public_Name;
> >      procedure Process( Input : Public_Name );
> > private
> >      type Private_Type is record ... end record;
> >      type Public_Name is access all Private_Type;
> > end Test;
> 
> I don't know if this will compile, but it's certainly not possible to
> use it; if Public_Name is _limited_ private, clients have no
> assignment operation.

The OP stated that he didn't want the client to create variables of the
type, but instead pass function results to other subprograms. So this
could be used as

Process (Input => Initialize ("File_Name") );

-- 
Jeff Carter
"You couldn't catch clap in a brothel, silly English K...niggets."
Monty Python & the Holy Grail



  parent reply	other threads:[~2002-07-07 17:15 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-06 17:17 Hiding a type Ryan Tarpine
2002-07-06 21:30 ` Pat Rogers
2002-07-06 18:16   ` Ryan Tarpine
2002-07-06 22:49     ` sk
2002-07-06 22:52     ` Frank J. Lhota
2002-07-06 20:38       ` Ryan Tarpine
2002-07-07 10:31         ` Frank J. Lhota
2002-07-07 11:20       ` Simon Wright
2002-07-07 13:58         ` Frank J. Lhota
2002-07-07 22:24           ` Ryan Tarpine
2002-07-07 17:15         ` Jeffrey Carter [this message]
2002-07-07 17:58           ` Simon Wright
2002-07-06 23:10     ` chris.danx
2002-07-06 20:21       ` Ryan Tarpine
2002-07-07  1:58         ` Jeffrey Carter
2002-07-08  7:20         ` Preben Randhol
2002-07-06 23:12       ` chris.danx
replies disabled

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