From: Matthew Kerwin Date: 2012-05-25T10:57:04+09:00 Subject: Re: looking for a ruby idiom : r=foo; return r if r On 25 May 2012 01:14, Robert Klemme wrote: > On Thu, May 24, 2012 at 4:50 PM, botp wrote: >> thank you all, matt/llelan/robert. > > You're welcome! Ditto. > 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...") Clear documentation and commenting can help there. > But I think the idiom with "and" is superior. :-) It's concise, but it's a very idiomatic idiom. At a glance it's harder to understand than the 'if r=foo..' construct (which is also idiomatic). If you use it in all your code, however, I won't complain. ;) --   Matthew Kerwin, B.Sc (CompSci) (Hons)   http://matthew.kerwin.net.au/   ABN: 59-013-727-651   "You'll never find a programming language that frees   you from the burden of clarifying your ideas." - xkcd