From: Simon Wright <simon@pogner.demon.co.uk>
Subject: Re: Safety of the Booch Ada 95 Components
Date: 1999/12/14
Date: 1999-12-14T00:00:00+00:00 [thread overview]
Message-ID: <x7v3dt51cj8.fsf@pogner.demon.co.uk> (raw)
In-Reply-To: 38558788.33C493B@mitre.org
"Robert I. Eachus" <eachus@mitre.org> writes:
> Hyman Rosen wrote:
>
> > Why is an assignment operator that raises an exception broken?
>
> It isn't. But in Ada, an assignment that raises an exception does so
> before actually "copying the bits."
I don't believe this is true. See LRM 7.6(2).
> So that objects that were
> consistant are not broken except by an explicit abort from some other
> task while outside an abort-deferred region. However, one explicit
> abort-deferred operation is: "an assignment operation to an object with
> a controlled part." RM9.8(11) There other such operations included so
> that a user of an object of a controlled type can expect that the value
> is never corrupted.
>
> So any user of an Ada package which did corrupt objects in this
> manner would be consider it to be broken.
Since (LRM 7.6(2)) Adjust is called as the _last_ step of an
assignment, I don't see how the provider of an Ada package can do as
you ask.
I'm going to do a deep copy.
I have an object containing a pointer to the value that has been
assigned, so I need to make the deep copy and then put a pointer to
the copy in the current object.
If that fails, presumably because of memory exhaustion, I can
(1) make sure that the assignee has a valid but partial copy
(2) make sure that the assignee has a null pointer
(3) leave the assignee pointing to the value that has been assigned,
so that the copy isn't deep after all
(4) not bother
In *none* of these cases is the assignee "valid". Whether that equates
to being "corrupt" is a question I prefer to leave to the reader ..
next prev parent reply other threads:[~1999-12-14 0:00 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-12-10 0:00 Safety of the Booch Ada 95 Components Harry Erwin
1999-12-10 0:00 ` Matthew Heaney
1999-12-10 0:00 ` Hyman Rosen
1999-12-10 0:00 ` Harry Erwin
1999-12-10 0:00 ` Matthew Heaney
1999-12-11 0:00 ` Harry Erwin
1999-12-12 0:00 ` Robert Dewar
1999-12-12 0:00 ` Harry Erwin
1999-12-13 0:00 ` Kent Paul Dolan
1999-12-13 0:00 ` Simon Wright
1999-12-13 0:00 ` Ted Dennison
1999-12-13 0:00 ` Robert I. Eachus
1999-12-13 0:00 ` Hyman Rosen
1999-12-13 0:00 ` Robert I. Eachus
1999-12-14 0:00 ` Simon Wright [this message]
1999-12-15 0:00 ` Mats Weber
1999-12-17 0:00 ` Simon Wright
1999-12-15 0:00 ` Harry Erwin
1999-12-14 0:00 ` Matthew Heaney
1999-12-10 0:00 ` Harry Erwin
1999-12-12 0:00 ` Simon Wright
1999-12-12 0:00 ` Harry Erwin
1999-12-13 0:00 ` Simon Wright
1999-12-10 0:00 ` Simon Wright
1999-12-12 0:00 ` Harry Erwin
1999-12-13 0:00 ` Simon Wright
1999-12-12 0:00 ` Simon Wright
1999-12-12 0:00 ` Matthew Heaney
1999-12-13 0:00 ` Tucker Taft
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox