comp.lang.ada
 help / color / mirror / Atom feed
* access-to-constant dispatching params
@ 2000-05-08  0:00 m_cubed
  2000-05-08  0:00 ` Tucker Taft
  2000-05-08  0:00 ` Andy
  0 siblings, 2 replies; 6+ messages in thread
From: m_cubed @ 2000-05-08  0:00 UTC (permalink / raw)


Ada provides access-to-variable dispatching
parameters.

For example:

procedure Set_Exercise_Mode (
  State_Ptr: access State_Type;
  Exercise_Mode: in Exercise_Mode_Type);


What it doesn't seem to provide is
access-to-constant dispatching parameters.
It would be useful to be able to ensure that
a query on an object is prevented from
accidentally updating the object. For example,
(in hypothetical syntax):

function Exercise_Mode (
  State_Ptr: access constant State_Type)
  return Exercise_Mode_Type;


Is there any way of obtaining access-to-constant
dispatching parameters or am I forced to sacrifice
dispatching by using a specific access-to-constant
type:

type RO_Access_State_Type is
  access constant State_Type;

function Exercise_Mode (
  State_Ptr: RO_Access_State_Type)
  return Exercise_Mode_Type;?


Are access-to-constant dispatching parameters
being considered for a future version of Ada?


Sent via Deja.com http://www.deja.com/
Before you buy.




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2000-05-09  0:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-05-08  0:00 access-to-constant dispatching params m_cubed
2000-05-08  0:00 ` Tucker Taft
2000-05-09  0:00   ` don_harrison
2000-05-09  0:00     ` Tucker Taft
2000-05-08  0:00 ` Andy
2000-05-09  0:00   ` don_harrison

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