From: Phlip Date: 2009-02-16T21:10:11+09:00 Subject: Re: What are your favorite Ruby features? Bezan Kapadia wrote: > Exception Handling , though it gets wacky at times... The great thing about blocks is you can hide the wackiness: def foo x = 42 yield_me do return x + 1 end end def yield_me prepare() yield() explode() ensure cleanup() end That is the "execute around pattern" - prepare() and cleanup() will always call around blocks passed to yield_me. Even if the block raises an exception. Question - does the return throw away the explode() call? I have not yet bothered to determine this while coding, though I may even have used the effect in others' blocks, already! -- Phlip