From: Dave Thomas Date: 2001-09-19T10:04:46+09:00 Subject: [ruby-talk:21364] Re: destructor jweirich@one.net writes: > Now, create a sandwich function using blocks ... > > def sandwich > create_a_resource # Top Bread Slice > yield > ensure > close_the_resource # Bottom Bread Slice > end I _think_ that in this case you need the 'begin': def sandwich res = create begin yield res ensure res.close end end (you don't want to catch exceptions during creation) Regards Dave