From: dblack@... Date: 2006-06-24T20:58:20+09:00 Subject: Re: prop = x => y Hi -- On Sat, 24 Jun 2006, Roger Johansson wrote: > Why cant I do things like: > > my_prop = :foo => :bar > > when its possible to do: > > my_meth :foo => :bar > > ?? > > ive tried with > my_prop = (:foo => :bar) > to but no luck.. You need to use the hash literal constructor: my_prop = { :foo => :bar } The only time you're allowed *not* to use it, and still have Ruby know that you're trying to construct a hash, is the special case of a method call: my_meth :a => "b", :c => "d" which is equivalent to: my_meth({:a => "b", :c => "d"}) David -- David A. Black (dblack@wobblini.net) Ruby Power and Light, LLC (http://www.rubypowerandlight.com) See what the readers are saying about "Ruby for Rails"! http://www.rubypowerandlight.com/quotes