comp.lang.ada
 help / color / mirror / Atom feed
From: jls@yoda.Rational.COM (Jim Showalter)
Subject: Re: Reference vs. copy semantics in passing parameters
Date: 18 Feb 91 00:36:28 GMT	[thread overview]
Message-ID: <jls.666837388@yoda> (raw)
In-Reply-To: 2742@sparko.gwu.edu

Yes, but you miss my point (I think?). It is not modification of the
POINTER we are trying to prevent. We are trying to prevent modification
of what the pointer points to, and there is currently no way to insure
this in Ada. A doofus can break the rules with impunity.

Why would it BE a pointer? Beats me, but these things do happen from time
to time, and when they do it would be nice if the language made them safe.

One gross thing that people do currently is give IN/OUT semantics to
parameters on functions by passing a pointer and dereferencing it inside
the function to modify what the pointer points to. There is no way to
prevent this egregious behavior at present (note: many many people have
also requested that 9x include IN/OUT's on functions, which would make
the case for performing the trick just described even weaker).
--
***** DISCLAIMER: The opinions expressed herein are my own. Duh. Like you'd
ever be able to find a company (or, for that matter, very many people) with
opinions like mine. 
                   -- "When I want your opinion, I'll beat it out of you."

  parent reply	other threads:[~1991-02-18  0:36 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1991-02-11 15:06 ADA Compiling Query Gordon Russell
1991-02-12 19:01 ` Michael Feldman
1991-02-13 21:16 ` Jeff Bartlett
1991-02-14 16:45   ` Michael Feldman
1991-02-15 23:09     ` Jim Showalter
1991-02-17  0:19       ` Reference vs. copy semantics in passing parameters Michael Feldman
1991-02-17 18:54         ` Erland Sommarskog
1991-02-18 18:41           ` Doug Smith
1991-02-18  0:36         ` Jim Showalter [this message]
1991-02-18  1:42           ` Michael Feldman
1991-02-18 18:49           ` Arthur Evans
1991-02-19  2:05             ` Michael Feldman
1991-02-18 13:10         ` madmats
1991-02-19 19:00           ` Robert I. Eachus
1991-05-16 13:51         ` Alex Blakemore
1991-05-17  8:19           ` Matthias Ulrich Neeracher
1991-05-17 13:44           ` Markku Sakkinen
1991-05-28  5:28           ` Kenneth Almquist
1991-02-18 14:33 ` ADA Compiling Query stt
replies disabled

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