From: Trans Date: 2006-11-13T22:15:08+09:00 Subject: Re: returning keyword S. Robert James wrote: > Thanks. > > Wow! That's an example of clever code. The code's less clear, no > shorter, and confusing to someone not familiar with this new method - > and for what? To be able to show off cool meta programming? > > I think Rails is great, but someone needs to remind people that "clever > code" is an insult. I disagree. It's not an uncommon to see the pattern: def foo o = Somthing.new # muckaround with o return o end The #returning method provides the same kind of "block orientation" we use with files. def foo returning Something.new do |o| # muckaround with o end end In simple cases, sure, it's no dig deal. But in more complex cases it lends to readability b/c it tells us what we're after from the start. T.