Dave Thomas et al have discussed this back in 2001,
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/20991

they use 'ensure' in their solution, but it's an interesting read
anyway.


Sam Kong wrote:
> Hi!
> 
> A friend of mine challenged me with Smalltalk.
> He's a big fan of Smalltalk.
> He asked me what I can do if I want to add "try ~ finally ~" systax in
> Ruby.
> Yes, we already have "begin ~ ensure ~".
> But he asked me whether Ruby is flexible enough to extend such a thing
> without changing the language itself.
> He said that Smalltalk doesn't have "try ~ finally ~" in the language
> but can be defined without changing the language.
> 
> Personally, I don't think such flexibility is really needed.
> However, I want to defend Ruby.
> How would you react such an attack?
> 
> Disclaimer: This post is not for language flame war but for better
> understanding of Ruby.
> 
> Thanks.
> 
> Sam