comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: protected types and functions in Ada95 (Newbie)
Date: 1997/04/25
Date: 1997-04-25T00:00:00+00:00	[thread overview]
Message-ID: <dewar.861973182@merv> (raw)
In-Reply-To: E957px.9qG@world.std.com


Bob says

<<It's annoying that functions don't take 'in out' parameters.
The best workaround is probably to use an access parameter.
Then declare your objects aliased, and pass 'Access of them.>>

I must admit that in the GNAT world, when writing standard libraries
(including the predefined random numbe generator, where we cannot change
to use 'Access because the interface was not designed that way, and in 
the SPITBOL package for example), I am making more and more use of the
GNAT specific approach that allows one to take ;'Unrstricted_Access
of a formal parameter if it is passed by reference.

yes, this is horrible, but it is better to have a horrible kludge in
the implementation of the body, than force kludges on all implementors.
(sorry I mean by implementors here, clients who use the package).

I still find the omission  of in-out parameters in functions to be the
most annoying concession to the viewpoint that the language should
enforce some particular philosophy, even if it means putting in
arbitrary non-orthogonal restrictions.





  reply	other threads:[~1997-04-25  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-04-24  0:00 protected types and functions in Ada95 (Newbie) Magnus Therning
1997-04-24  0:00 ` Robert A Duff
1997-04-25  0:00   ` Robert Dewar [this message]
1997-04-24  0:00 ` Jon S Anthony
replies disabled

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