From: Gavin Sinclair Date: 2002-08-17T12:50:10+09:00 Subject: Re: Difference between proc.call and yield? ----- Original Message ----- From: "Dan Debertin" > Consider the following contrived examples: But I hate contrived examples! > def func1() > ret = [] > t = nil > 5.times do |i| > t = yield i > ret << t > end > ret > end > > func1 { |b| b + 10 } # [ 10, 11, 12, 13, 14 ] > > def func2(&block) > ret = [] > t = nil > 5.times do |i| > t = block.call(i) > ret << t > end > ret > end > > func2 { |b| b + 10 } # [ 10, 11, 12, 13, 14 ] > > Is this just TMTOWTDI, or is there a difference? AFAIK, TMTOWTDI. GS > Dan