On Sun, 2008-08-17 at 14:24 -0400, Charles Oliver Nutter wrote:
> >> Is this really what we want?
> > 
> > I don't think it is.  This kind of thing is going to create bad problems
> > for parts of Omnibus as well.
> 
> I would clarify one thing though: the propagating Java exceptions will 
> still cause ensured sections to execute, since we use finally. So if 
> it's ensured sections you're worried about, they should be ok.

Principally, I do not want to have to write this:

 exception = nil
 begin
   value = yield
 rescue Exception => exception
 end

 if exception
   fail_with exception
 else
   succeed_with value
 end

As e.g. this:

 ok = false
 begin
   value = yield
   ok = true
 rescue Exception => exception
 ensure
   if ok
     succeed_with value
   elsif exception
     fail_with exception
   else
     fail_with RuntimeException.new("Unknown exception")
   end
 end

-mental

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to