From: Joel VanderWerf Date: 2005-05-13T07:45:29+09:00 Subject: Re: {} vs begin/end [was Re: object loops and what they return] Ben Giddings wrote: > On Thursday 12 May 2005 15:22, Joel VanderWerf wrote: > >>But then there would be the similarity between >> >>["a" => "b"] # Hash >> >>and >> >>["a" <= "b"] # Array > > > How is that one an array? Oh, is it an array containing 'true'? irb(main):001:0> ["a" <= "b"] => [true] > I've never been super fond of '=>' as a syntax for creating hashes, but I > can accept it. The point I'm trying to make is that currently it's easy > to visually confuse a block and a hash. I'd prefer if array, block and > hash were all visually distinct, but I think it's much less dangerous to > have arrays and hashes look similar because they are similar creatures. OTOH, hashes and arrays tend to be used in the same kinds of places, and blocks tend to be in different places, so context helps us distinguish hashes from blocks in the current syntax.