comp.lang.ada
 help / color / mirror / Atom feed
From: Ted Dennison <dennison@telepath.com>
Subject: Re: Ada Queue
Date: 2000/04/07
Date: 2000-04-07T00:00:00+00:00	[thread overview]
Message-ID: <8cldq0$bvt$1@nnrp1.deja.com> (raw)
In-Reply-To: 38edcbf2@news.hamilton.edu

In article <38edcbf2@news.hamilton.edu>,
  "Joseph T" <thisthat7@hotmail.com> wrote:
>
> >It would perhaps have been clearer for the reader to use a temporary
> >variable to iterate, but there are no other drawbacks associated with
> >his method, which is indeed a very common way of doing it in C.
>
> Which method is a common way of doing it in C?  Using the temporary
> variable to iterate or not?

In C all parameters are passed by copy-in. That means that *both*
the local variable and the parameter can be considered "temporaries".
Neither get passed back to the user, only the object of the "return"
goes back. So really either is just as good.

But for your Ada code you (quite reasonably) used an "in out" parameter.
But that means *any* assignment to that parameter potentially goes out
to the user. This is a very different situation.

--
T.E.D.

http://www.telepath.com/~dennison/Ted/TED.html


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




  reply	other threads:[~2000-04-07  0:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-04-06  0:00 Ada Queue Joseph T.
2000-04-06  0:00 ` Ted Dennison
2000-04-06  0:00   ` Joseph T
2000-04-06  0:00     ` Robert Dewar
2000-04-06  0:00       ` Joseph T
2000-04-07  0:00         ` Ole-Hjalmar Kristensen
2000-04-06  0:00       ` Ted Dennison
2000-04-06  0:00     ` Ted Dennison
2000-04-06  0:00       ` Joseph T.
2000-04-07  0:00         ` Ole-Hjalmar Kristensen
2000-04-07  0:00           ` Joseph T
2000-04-07  0:00             ` Ted Dennison [this message]
2000-04-07  0:00         ` Ted Dennison
2000-04-07  0:00           ` Hyman Rosen
2000-04-06  0:00     ` tmoran
2000-04-08  0:00       ` tmoran
2000-04-07  0:00 ` MaggieJohn
2000-04-07  0:00   ` Ted Dennison
2000-04-07  0:00 ` Simon Wright
2000-04-09  0:00   ` Robert Dewar
replies disabled

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