From: "Marcin Mielżyński" Date: 2006-07-09T04:25:07+09:00 Subject: Re: Sweet Lord! Phil Tomson wrote: >> >> def each >> while input = gets >> yield input.chomp >> end >> end > > Equivilent code, actually. It's a case of "you say tomaTOE I say tomAHto" > Personally, I tend to prefer the 'block.call' because you explicitly > say you're passing in a block in the definition of the method, so if > someone is reading your code they can easily tell that the method > takes a block. In the case of yield you might need to read through a > good bit of code before you find out that the method takes a block. > > > Phil > block.call is significantly slower since conversion from block to Proc object involves copying references of a closure to Proc instance. lopex