comp.lang.ada
 help / color / mirror / Atom feed
From: "Peter C. Chapin" <pchapin@sover.net>
Subject: Re: Controlled types and exception safety
Date: Tue, 06 Dec 2005 06:41:28 -0500
Date: 2005-12-06T06:41:28-05:00	[thread overview]
Message-ID: <439578e1$0$8168$6d3edbfc@news.sover.net> (raw)
In-Reply-To: <erojf.3796$A23.2613@newsread2.news.pas.earthlink.net>

Jeffrey R. Carter wrote:

>  For an assignment_statement, after the name and expression have been 
> evaluated, and any conversion (including constraint checking) has been 
> done, an anonymous object is created, and the value is assigned into it; 
> that is, the assignment operation is applied. (Assignment includes value 
> adjustment.) The target of the assignment_statement is then finalized. 
> The value of the anonymous object is then assigned into the target of 
> the assignment_statement. Finally, the anonymous object is finalized. As 
> explained below, the implementation may eliminate the intermediate 
> anonymous object, so this description subsumes the one given in 5.2, 
> ``Assignment Statements''.

I don't understand the point of the intermediate object. Since an adjust 
is done when assigning to the target object, what advantage does 
introducing the intermediate object have over just assigning to the 
target from the original source? The description above makes it sound 
like the system makes a pointless copy of the source object.

A (perhaps) related question: If exceptions can't propagate from Adjust, 
how does the caller know that X in 'X := Y' is in an invalid state 
should the Adjust fail? Is it necessary to set a flag in X and thus do

X := Y;
if X.invalid then
   raise Failed_Assignment;
end if;

Peter



  parent reply	other threads:[~2005-12-06 11:41 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-30 13:57 Controlled types and exception safety Maciej Sobczak
2005-11-30 15:06 ` Dmitry A. Kazakov
2005-11-30 16:19   ` Maciej Sobczak
2005-12-01  0:05     ` Stephen Leake
2005-12-01  9:21     ` Dmitry A. Kazakov
2005-12-01 10:46       ` Maciej Sobczak
2005-12-01 15:08         ` Dmitry A. Kazakov
2005-12-02  4:17           ` Randy Brukardt
2005-12-02  9:29             ` Maciej Sobczak
2005-12-02 18:12               ` tmoran
2005-12-02 19:15                 ` Robert A Duff
2005-12-02 21:42                   ` tmoran
2005-12-06  9:00                     ` Maciej Sobczak
2005-12-06  9:50                       ` Dmitry A. Kazakov
2005-12-06 18:34                         ` Jeffrey R. Carter
2005-12-06 19:34                           ` Randy Brukardt
2005-12-06 21:20                             ` Dmitry A. Kazakov
2005-12-07  1:57                             ` Jeffrey R. Carter
2005-12-08  0:50                               ` Randy Brukardt
2005-12-08 19:37                                 ` Jeffrey R. Carter
2005-12-09  2:36                                   ` Randy Brukardt
2005-12-09  6:33                                     ` Jeffrey R. Carter
2005-12-09 20:35                                       ` Randy Brukardt
2005-12-10  7:53                                         ` Jeffrey R. Carter
2005-12-06 20:43                           ` Dmitry A. Kazakov
2005-12-07  2:00                             ` Jeffrey R. Carter
2005-12-07 10:01                               ` Dmitry A. Kazakov
2005-12-02 23:21             ` Robert A Duff
2005-11-30 17:46 ` Jean-Pierre Rosen
2005-11-30 21:02 ` Jeffrey R. Carter
2005-11-30 22:06   ` Björn Persson
2005-11-30 23:52     ` Randy Brukardt
2005-12-01  5:26     ` Jeffrey R. Carter
2005-12-02 23:51       ` Robert A Duff
2005-12-06 11:41   ` Peter C. Chapin [this message]
2005-12-06 12:50     ` Jean-Pierre Rosen
2005-12-06 13:06     ` Dmitry A. Kazakov
replies disabled

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