From: Adam Gardner Date: 2009-04-09T23:35:31+09:00 Subject: Re: Hash questions > From what I can tell, ruby is interpreting the beginning of your hash as > the beginning of a block, instead; > p({"foo" => 1, "bar" => 2, "baz" => 3 }) works as intended. > > This is seems like a bug to me, although whether it's a bug with the > parser (finding a block where it should be looking for a hash literal), > a bug with p (asking for a block when it doesn't use one) or the > documentation (failing to mention that p accepts a block), I'm not sure. Actually, on a bit more inspection, both puts and print work the same way, and I imagine there are other methods that do this as well. This just seems like the parser failing to correctly interpret the ambiguity of a {. -- Posted via http://www.ruby-forum.com/.