comp.lang.ada
 help / color / mirror / Atom feed
From: mfeldman@seas.gwu.edu (Michael Feldman)
Subject: Re: parameter passing
Date: 27 Jun 90 17:15:27 GMT	[thread overview]
Message-ID: <1986@sparko.gwu.edu> (raw)
In-Reply-To: 1569@oravax.UUCP

In article <1569@oravax.UUCP> davidg@oravax.UUCP (David Guaspari) writes:
>Certain kinds of reasoning about Ada subprograms that terminate by
>raising exceptions are considerably simplified if one is allowed to
>make the following assumption:
>
>   If a and b are actual parameters to some call of subprogram P,
>   and a and b are of the same type, then that call passes them
>   in the same way (either both by copy or both by reference).
Scalars are passed by copy - always. Structures and arrays can be
passed by reference or by copy. I can speak for a few compilers I know
(but don't remember which is which) - many systems will gauge which way
to pass based on the size of the parameter. That is, arrays known to be 
"small" will be copied, but arrays not known to be small - either known to
be large, or unconstrained and of unknown size - will be passed by reference.
Since constrained objects of an unconstrained type have different subtypes
but the same type, what you say holds true in my experience. I can't imagine
why different objects of the same type should be passed differently. But
then again, there are a lot of imaginable things _I_ can't imagine.
Great question for language lawyers!
---------------------------------------------------------------------------
Prof. Michael Feldman
Department of Electrical Engineering and Computer Science
The George Washington University
Washington, DC 20052
+1-202-994-5253
mfeldman@seas.gwu.edu
---------------------------------------------------------------------------

  parent reply	other threads:[~1990-06-27 17:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1569@oravax.UUCP>
1990-06-27 15:32 ` parameter passing stt
1990-06-27 17:15 ` Michael Feldman [this message]
2000-02-17  0:00 Riyaz Mansoor
2000-02-18  0:00 ` Richard D Riehle
2000-02-19  0:00 ` Ehud Lamm
  -- strict thread matches above, loose matches on Subject: below --
1990-06-29 15:32 David Guaspari
1989-06-21 13:16 Parameter Passing Jon Humphreys
1989-06-21 17:23 ` William Thomas Wolfe,2847,
1986-10-08 18:56 parameter passing Eric Marshall
1986-10-10 16:46 ` Geoff Mendal
1986-10-30 23:08   ` Mats_Ohlin_FOA2
replies disabled

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