finalisation

Craig Latta craig at netjam.org
Fri Jan 23 17:31:37 UTC 2004


> ...if you cannot really handle the failure...

	In this case, as I mentioned elsewhere in this thread, the solution is
to raise an exception in the file-creation behavior, instead of
answering nil. Then one can handle the failure, quite literally (with an
exception handler).

> ...and you agreed that it wouldn't prevent a dangling resource
> pointer...

	The part of my point you're leaving out is that my suggestion was for
better coverage, although not complete (given that the file-creation
behavior is broken).

> ...what's gained by putting the creation inside the ensured block
> except from having to add explicit guards for the cleanup code?

	What's gained is the occlusion of a failure mode which I have seen and
which is not pleasant. And, as I have also already mentioned in this
thread, those guards aren't necessary if one is willing to define a
no-op UndefinedObject>>close.


-C

--
Craig Latta
improvisational musical informaticist
craig at netjam.org
www.netjam.org
[|] Proceed for Truth!




More information about the Squeak-dev mailing list