How would you write this without exception handling, how would that make it any easier? Perhaps do not put the entire loop in the try catch, but just the single iteration.
The authors of the paper propose their "worlds" API as a way to make writing safe code easier. They're still using exceptions, but they would require no cleanup...
The code becomes:
try {
in thisWorld.sprout() {
for (var idx = 0; idx < xs.length; idx++)
xs[idx].update();
thisWorld.commit();
}
} catch (e) {
// no clean-up required!
}
So it's commit for data structures for data structures. If an exception is thrown and the commit line is not executed, no changes will be visible.