From: Joel VanderWerf Date: 2004-04-22T04:37:25+09:00 Subject: Re: TCLTK didn't work with do ... end ?? Daniel Bovensiepen [bovi] wrote: ... > command proc { > puts 'klick' > } ... > why didn't work the 'command proc' with a do ... end? ... > command proc do > puts 'klick' > end It's because of precedence. In the first case, the {...} is associated with 'proc'. In the second case, it is associated with 'command'. This may show it more clearly: def foo(*args, &bl) puts "In foo: got args == #{args.inspect}" puts "In foo: got block == #{bl.inspect}" end def bar(*args, &bl) puts "In bar: got args == #{args.inspect}" puts "In bar: got block == #{bl.inspect}" end foo bar {} foo bar do end -- output -- In bar: got args == [] In bar: got block == # In foo: got args == [nil] In foo: got block == nil In bar: got args == [] In bar: got block == nil In foo: got args == [nil] In foo: got block == #