comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <jeffrey.carter@boeing.com>
Subject: Re: Parameters in Sub
Date: Fri, 21 Sep 2001 18:28:09 GMT
Date: 2001-09-21T18:28:09+00:00	[thread overview]
Message-ID: <3BAB86B9.1A9402FF@boeing.com> (raw)
In-Reply-To: 31Kq7.9078$p77.31214@www.newsranger.com

Ted Dennison wrote:
> 
> A slightly more complete answer is that there are some situations where the
> language specifies reference passing, but in all other situations it is up to
> the compiler. 

This is not completely correct (see ARM 6.2). Elementary types (such as
integral and real types) are always passed by copy. Tagged types and
limited types are always passed by reference, as are composite types
with a component that must be passed by reference. Other types do not
have their passing mechanisms specified; it is up to the compiler to
decide.

I think the original poster was attempting to equate parameter modes
with parameter passing mechanisms. This is a common mistake for Ada
beginners who know languages in which the coder specifies the passing
mechanism (such as Pascal).

The original poster should become aware that there is no relationship
between the parameter mode (in, in out, or out) and the parameter
passing mechanism. The parameter mode is a high-level specification of
how the parameter is used by the subprogram.

-- 
Jeffrey Carter



  reply	other threads:[~2001-09-21 18:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-21 16:37 Parameters in Sub Ted Dennison
2001-09-21 18:28 ` Jeffrey Carter [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-09-21 15:13 Marc
replies disabled

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