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,e7eb1c5f294e17be X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-01-30 17:05:39 PST Newsgroups: comp.lang.ada Path: nntp.gmd.de!newsserver.jvnc.net!nntpserver.pppl.gov!princeton!udel!news.mathworks.com!news.alpha.net!uwm.edu!vixen.cso.uiuc.edu!howland.reston.ans.net!ix.netcom.com!netcom.com!NewsWatcher!user From: hbaker@netcom.com (Henry Baker) Subject: Re: Assignment of limited private types... Message-ID: Sender: hbaker@netcom.com (Henry G. Baker) Organization: nil References: <3gjce1$1he@theopolis.orl.mmc.com> Date: Tue, 31 Jan 1995 01:05:39 GMT Date: 1995-01-31T01:05:39+00:00 List-Id: In article <3gjce1$1he@theopolis.orl.mmc.com>, "Theodore E. Dennison" wrote: > stevem@dcs.gla.ac.uk (Steve McGowan) wrote: > > > > I'd like to pass in a 'file_type' identifier into a task, make a local > > copy of this identifier within the task, and then write text to this > > file stream inside the task. > > But I cannot do this since 'file_type' is limited private. > > Any ideas how I can pass in this identifier, and to write to it > > locally? > > The reason people make types "limited private" is so users CAN'T > make local copies of the objects. If the designer wanted you to > be able to make copies of file_type objects, she would have made > the type "private". That may have been the original intent, but that isn't what Ada ended up with. What you describe requires a _read_ barrier, but Ada only gives you a _write_ barrier. Limited private types can't be assigned to, but can easily be read from, and 'copies' made. Put your WWW browser onto the following URL's for more background on limited private types: ftp://ftp.netcom.com/pub/hb/hbaker/LimitedRoots.html (or .ps.Z) ftp://ftp.netcom.com/pub/hb/hbaker/LimitedRobbery.html (or .ps.Z) ftp://ftp.netcom.com/pub/hb/hbaker/LPprogram.html (or .ps.Z)