From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: How do typical Ada calling conventions work ?
Date: Mon, 31 Aug 2015 18:01:26 -0500
Date: 2015-08-31T18:01:26-05:00 [thread overview]
Message-ID: <ms2mc6$88a$1@loke.gir.dk> (raw)
In-Reply-To: 55dbfddd$0$20676$862e30e2@ngroups.net
"Per Sandberg" <per.s.sandberg@bahnhof.se> wrote in message
news:55dbfddd$0$20676$862e30e2@ngroups.net...
...
> If you want to use a function "returning" large or limited objects you
> could always use the "extended return" where the returned object will be
> created in place.
>
> type large_or_limited is ....;
> function my_function return large_or_limited is
> begin
> return ret : large_or_limited do
> do_what_you_need;
> end return;
> end my_function;
As noted by Christophe, the syntax of a return statement has no effect on
how objects are returned. The compiler might use build-in-place semantics
for all returns or none; it's only required for inherently limited objects.
It's highly unlikely that a compiler would act differently for extended
returns rather than simple returns, because that would make calls dependent
on the contents of the body.
Randy.
next prev parent reply other threads:[~2015-08-31 23:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-21 8:37 How do typical Ada calling conventions work ? Hadrien Grasland
2015-08-21 10:41 ` Markus Schöpflin
2015-08-21 12:47 ` Niklas Holsti
2015-08-22 8:31 ` Hadrien Grasland
2015-08-24 22:03 ` Randy Brukardt
2015-08-25 5:32 ` Per Sandberg
2015-08-25 7:05 ` AdaMagica
2015-08-25 7:28 ` AdaMagica
2015-08-31 23:01 ` Randy Brukardt [this message]
2015-08-25 18:38 ` gautier_niouzes
2015-08-26 15:53 ` Hadrien Grasland
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox