From: Michael Neumann Date: 2001-07-17T18:14:03+09:00 Subject: [ruby-talk:17974] Re: {} -vs- do/end blocks Matt Armstrong wrote: > I have a beginner Ruby question. You can do this: > > @foo.each { |i| > ... > } > > Or you can do this: > > @foo.each do |i| > ... > end > > Why the two forms? What are the advantages of each? They differ only in precedence: @foo.each aMethod { |i| ... } is the same as x = aMethod { |i| .. } @foo.each x whereas @foo.each aMethod do |i| ... end is @foo.each( aMethod ) do |i| ... end Regards, Michael -- Michael Neumann merlin.zwo InfoDesign GmbH http://www.merlin-zwo.de