------art_13224_619102.1151365450330
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

 On 6/26/06, Matthew Harris <shugotenshi / gmail.com> wrote:

> I like Michael's solution.
>
> The {}'s are not needed, as long as the hash is the only or last
> argument to a method.
>
> {:a 1, :b 2}.merge(:c 3, :d 4)
> #{:a 1, :b 2, :c 3, :d 4)
>
I noticed this:

class Hash
  def <<(arg)
    self.merge!(arg)
  end
end

x   :a 1 }

x.<< :f 1, :g 1   # works

x << :h 1, :i 1   # syntax error

Is there a way to make the above work? I don't care really since I think the
following is clearer:
x << { :h 1, :i 1 }  # my preferred


Cheers,
Simon.


-- 
Simon Baird <simon.baird / gmail.com>

------art_13224_619102.1151365450330--