From: Hal Fulton Date: 2005-11-18T15:36:37+09:00 Subject: Re: Block Syntax Error newbie wrote: > Hi, > Please see the following code > ===>8======================= > def func *args,&blk > puts *args > instance_eval &blk > end > > func("a str") {puts "blk"} #OK > func "a str" do puts "blk" end #OK > > func "a str" {puts "blk"} #Sytax Error!? > ===>8======================= > > The last call give a syntax error, which part confuse ruby? In my personal opinion, this is one of those things that "should" work. But the Ruby parser is very complex. (Just ask anyone who has tried to write another one.) I am not sure exactly what is happening here, but I would tend to think it is a side effect of the way the yacc grammar is written. Hal