From: Robert Klemme Date: 2012-05-25T00:14:17+09:00 Subject: Re: looking for a ruby idiom : r=foo; return r if r On Thu, May 24, 2012 at 4:50 PM, botp wrote: > thank you all, matt/llelan/robert. You're welcome! > r=foo and return r > > is good, but i think i'll stick w the older if r=foo style...(in the meantime :) I wouldn't do that, there is a certain risk that it looks like a typing error (i.e. someone assumes you meant "if r==foo..."). If I would want to use "if" then I'd do r = foo return r if r But I think the idiom with "and" is superior. :-) Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/