From: Chad Perrin Date: 2007-06-14T05:06:32+09:00 Subject: Re: a matter of style On Wed, Jun 13, 2007 at 09:37:58PM +0900, Yossef Mendelssohn wrote: > > > > 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 > > I think Chad's point stands. It seems whatever is encapsulated in the > enum's find search code would be better off as a method on that > object. That would make the test cleaner and then there won't be any > worry about block style precedence. Actually, I think you assumed more meaning in what I said than I intended. The same goes for the previous poster, too. I didn't mean that the precedence diference wouldn't or shouldn't prompt you to choose wisely between do...end and {...} syntaxes -- only that the difference in precedence *between the two* isn't something I'd seen, or probably should see. I mean precedence "between the two" in the same way I'd mean it in relation to + and * operators: when stringing things together, the precedence of + and * in relation to one another becomes important, such as in this case of potentially ambiguous intent: 1 + 2 * 4 -- CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ] Dr. Ron Paul: "Liberty has meaning only if we still believe in it when terrible things happen and a false government security blanket beckons."