From: klochner Date: 2009-01-29T06:22:37+09:00 Subject: Re: yield vs. return On Jan 28, 4:04 pm, "F. Senault" wrote: > Le 28 janvier 2009 à 21:09, klochner a écrit : > > > I see a lot of ruby programmers doing the latter, but consider the > > former to be more straightforward.  There are a lot of cases where > > yielding is more elegant than return, but I don't consider this to > > be one of them.  Anyone care to weigh in? > > Depends on what you do with it.  I kinda like to use yield in "builder" > statements where the code will we nested. > > The best (IMHO) is, of course, the freedom of : > > def funcfoo >   yield foo if block_given? >   foo > end thanks Fred, this sounds sane to me.