From: Austin Ziegler Date: 2006-05-19T07:50:35+09:00 Subject: Re: Rescue clauses on do/end blocks? On 5/18/06, Daniel Schierbeck wrote: > dblack@wobblini.net wrote: > > I'm not sure I get that distinction -- I mean, I understand that you > > do it that way, but I'm not sure there's any generally closer > > association between do/end and rescuing than there is between {} and > > rescuing. Also, they're sometimes used in the *same* places, but by > > different people :-) > Maybe it's time we make that distinction. From a syntactical point of > view, they're very different -- only the keyword/end syntax really > allows for such things as if/elsif/else/end and rescue clauses, unless > you want to add this to Ruby: Blocks are blocks. Stylistically, some people prefer braces, some people prefer do/end. There are people who will do everything they can to make sure that they always use the same style. There are people who use {} for blocks that return a value (and the exception handler is *very* important there) and do/end for those that don't. There are people who use {} for one-liners and do/end for multi-liners. The curly syntax is *not* just a shorthand. It has a different binding. -austin -- Austin Ziegler * halostatue@gmail.com * Alternate: austin@halostatue.ca