From: "Eric I." Date: 2007-06-18T06:30:09+09:00 Subject: Re: Syntax error with blocks The other thing to keep in mind is that blocks are parameters passed into methods, so they're always associated with a method call. For example: 10.times { puts 'foo' } The block is a parameter to the times method that is being called on the Integer 10. Even in Banzai's example: x = lambda { puts 'foo' } The block is passed to a method named lambda that returns a Proc of the block passed in. Eric ---- Are you interested in on-site Ruby training that uses well-designed, real-world, hands-on exercises? http://LearnRuby.com On Jun 17, 11:05 am, Oliver Sauders wrote: > OK guys, wtf am I doing wrong here? > The manual says I should be able to do this. > > ======================= > > irb(main):150:0> { puts 'foo' } > SyntaxError: compile error > (irb):150: syntax error, unexpected tSTRING_BEG, expecting kDO or '{' or > '(' > { puts 'foo' }