From: Bob Hutchison Date: 2007-11-10T08:19:36+09:00 Subject: Re: odd error On 9-Nov-07, at 6:13 PM, Roger Pack wrote: > irb(main):006:0> {}.merge {:a => 3} > SyntaxError: compile error > (irb):6: syntax error, unexpected tASSOC, expecting '}' > {}.merge {:a => 3} > > ??? > {}.merge({:a => 3}) works, though. Is this a grammar problem? Ambiguity I guess. It is taking the {:a => 3} as a block rather than as a hash argument (merge is defined to allow that). The parenthesis resolves the ambiguity. Cheers, Bob ---- Bob Hutchison -- tumblelog at http://www.recursive.ca/so/ Recursive Design Inc. -- weblog at http://www.recursive.ca/hutch http://www.recursive.ca/ -- works on http://www.raconteur.info/cms-for-static-content/home/