From: James Edward Gray II Date: 2007-06-13T06:51:54+09:00 Subject: Re: a matter of style On Jun 12, 2007, at 4:47 PM, Chad Perrin wrote: > On Tue, Jun 12, 2007 at 07:59:10PM +0900, dblack@wobblini.net wrote: >> On Tue, 12 Jun 2007, Anthony Martinez wrote: >>> On Tue, Jun 12, 2007 at 03:10:49AM +0900, Bas van Gils wrote: >> >>> As well, reserve the { } form of blocks to one-liners. >> >> That's going to depend partly on whether you run across the >> (relatively rare) case where the precedence difference between {} and >> do/end actually matters. There are also some interesting ideas on >> record (see archives) involving blocks with side effects vs. blocks >> that just calculate. But I can't remember which is supposed to be >> which :-) > > I have yet to see a practical case where the precedence actually came > into play -- and I suspect that, when I do finally see such a thing, > readability would benefit from a refactor so that it doesn't come into > play after all. assert_not_nil @enum.find do # ... a few lines of search code here ... end You need to switch block styles, add some parenthesis, or separate the two calls. James Edward Gray II