From: Hal Fulton Date: 2006-09-11T09:15:56+09:00 Subject: Re: Struggling with Blocks Paul Lutus wrote: > > "do" reads from a list of items and provides them to its controlling block: > > These two forms are interchangeable. One can argue that "do" is an implicit > "{ ... }" block, or the reverse. But the point is "do" receives items and > operates on them one at a time, then exits when its stream is empty. Not strictly true. Reemember that the iteration comes from the fact that the each method is invoking the block multiple times. Here's a do/end that will only execute once (and by the way has no parameters): Dir.chdir(some_dir) do process_something end And by the way, the rescue that can appear between def and end is rather an example of what some people want, IIUC. My impression is that do/end don't have a rescue basically to avoid unneeded complexity and because putting rescue inside {} for orthognality looks questionable. Hal