From: Mike Dvorkin Date: 2006-09-20T14:05:00+09:00 Subject: Re: => A newb question It's a little known fact, but just like Perl (but unlike PHP!) you can use commas instead of =>, for example: $ irb >> a = { 10, 'litte', :monkeys, 'jumping', 'on a bed' } SyntaxError: compile error (irb):1: odd number list for Hash from (irb):1 >> a = { 10, 'litte', :monkeys, 'jumping', 'on', 'a bed' } => {"on"=>"a bed", :monkeys=>"jumping", 10=>"litte"} And since it's a hash the order is not guaranteed (again, just like Perl, but unlike PHP). Mike Dvorkin http://www.rubywizards.com On Sep 19, 2006, at 8:18 PM, Devin Mullins wrote: > Dominic Son wrote: >> Thanks for the clarification. I feel like an enlightened newbie >> right now. > Keep in mind that you *can* use the = sign inside a Hash literal, > which is why it's not available for use by the Hash syntax: > hash = { :key => :value, :blah => foo = 5 } > p hash, foo > Not that that's not a really screwy thing to do... > > Devin >