From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Question on Controlled types
Date: Thu, 4 Jun 2009 17:03:16 +0200
Date: 2009-06-04T17:03:16+02:00 [thread overview]
Message-ID: <pk761me7pd9y$.fgwm6pk9h302$.dlg@40tude.net> (raw)
In-Reply-To: 8e08ed69-e0fb-4584-aa0f-521d472541bf@v4g2000vba.googlegroups.com
On Thu, 4 Jun 2009 07:34:43 -0700 (PDT), Hibou57 (Yannick Duch�ne) wrote:
> On 4 juin, 16:04, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
> wrote:
>>> So this means that if there was a second assignation of Delay1,
>>> Finalize would be invoked before the copy and the Adjust which will
>>> follow the copy ?
>>
>> Yes.
>
> So this implies that at execution time, distinction can be made
> between the first and the next assignement.
No, initialization is not an assignment. This difference was subtle in Ada
95, but in Ada 2005 is more obvious. Consider a limited type T and the
function Create that "returns" T:
X : T := Create; -- This is OK, because it is an initialization
begin
X := Create; -- This is illegal, because it would be an assignment
Further within Create:
function Create return T is
begin
return X : T [do ... end return]; -- This OK
end Create;
function Create return T is
X : T;
begin
return X; -- This is not OK, because it returns a local
-- limited object X, which is semantically equivalent
-- to an assignment
end Create;
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
next prev parent reply other threads:[~2009-06-04 15:03 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-30 11:41 Question on Controlled types Olivier Scalbert
2009-05-30 13:27 ` Dmitry A. Kazakov
2009-05-30 14:16 ` Olivier Scalbert
2009-05-30 14:48 ` Olivier Scalbert
2009-05-30 15:20 ` Robert A Duff
2009-05-30 15:40 ` Olivier Scalbert
2009-05-30 18:37 ` Robert A Duff
2009-06-04 12:32 ` Hibou57 (Yannick Duchêne)
2009-06-04 14:04 ` Dmitry A. Kazakov
2009-06-04 14:34 ` Hibou57 (Yannick Duchêne)
2009-06-04 15:03 ` Dmitry A. Kazakov [this message]
2009-06-04 15:13 ` Hibou57 (Yannick Duchêne)
2009-06-06 1:31 ` Randy Brukardt
2009-05-30 13:30 ` christoph.grein
-- strict thread matches above, loose matches on Subject: below --
2003-10-02 8:05 Question on controlled types christoph.grein
2003-10-01 20:03 Beard, Frank Randolph CIV
2003-10-02 18:45 ` Robert I. Eachus
2003-10-01 19:06 Alex Xela
2003-10-01 23:07 ` Matthew Heaney
2003-10-02 7:09 ` Alex Xela
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox