From: "David A. Black" Date: 2005-11-18T22:34:16+09:00 Subject: Re: Block Syntax Error Hi -- On Fri, 18 Nov 2005, 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? See other answers. I just want to put in a plug (since you're still a nuby :-) for using parentheses, especially in method definitions: def func(*args, &blk) I know it looks sort of cool without them, but I find (and I'm pretty sure I'm far from the only one) that I have more trouble parsing it visually, especially when you get things like: def a b, c = 100 which is legal but, to my eye, too thin on visual cues. David -- David A. Black dblack@wobblini.net