From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,1888e8caa20a2f2d X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!atl-c05.usenetserver.com!news.usenetserver.com!news-out.readnews.com!store-big1.readnews.com!198.186.190.61.MISMATCH!not-for-mail Date: Tue, 06 Dec 2005 06:41:28 -0500 From: "Peter C. Chapin" User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Controlled types and exception safety References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <439578e1$0$8168$6d3edbfc@news.sover.net> Organization: SoVerNet (sover.net) NNTP-Posting-Host: 56b602a0.news.sover.net X-Trace: 1133869282 news61.sover.net 8168 216.114.167.63:1519 X-Complaints-To: abuse@sover.net Xref: g2news1.google.com comp.lang.ada:6747 Date: 2005-12-06T06:41:28-05:00 List-Id: 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