comp.lang.ada
 help / color / mirror / Atom feed
From: stt@houdini.camb.inmet.com (Tucker Taft)
Subject: Re: Modest proposal, 2 of 3
Date: 1996/11/26
Date: 1996-11-26T00:00:00+00:00	[thread overview]
Message-ID: <E1I340.8M8.0.-s@inmet.camb.inmet.com> (raw)
In-Reply-To: 575ag6$rt6@netline-fddi.jpl.nasa.gov


Van Snyder (vsnyder@math.jpl.nasa.gov) wrote:

: ...
: PROPOSAL for next standardization of Ada

: Allow objects to be declared in the public part of a package
: specification with mode "out".  The meaning is that clients of the
: package can reference the variable, but can't store into it.

This can pretty much be accomplished in Ada 95 as follows:

   package P is
       type T is private;
       type T_Reader is access constant T;
       Read_Only_Global : constant T_Reader;
     ...
   private
       Global : aliased T;  -- Global variable
       Read_Only_Global : constant T_Reader := T'Access;
   end P;

You could also create a rename of "Read_Only_Global.all" if need be,
perhaps in a child package.

: ...
: What fraction of Americans believe   |  Van Snyder
: Wrestling is real and NASA is fake?  |  vsnyder@math.jpl.nasa.gov

--
-Tucker Taft   stt@inmet.com   http://www.inmet.com/~stt/
Intermetrics, Inc.  Cambridge, MA  USA




      parent reply	other threads:[~1996-11-26  0:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-11-22  0:00 Modest proposal, 2 of 3 Van Snyder
1996-11-23  0:00 ` Robert Dewar
1996-11-25  0:00 ` Norman H. Cohen
1996-11-26  0:00   ` Ken Garlington
1996-11-28  0:00   ` Richard A. O'Keefe
1996-11-26  0:00 ` Tucker Taft [this message]
replies disabled

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