From: "Jesús Gabriel y Galán" Date: 2010-09-11T06:56:08+09:00 Subject: Re: problem in hash and symbol On Fri, Sep 10, 2010 at 11:19 PM, Amir Ebrahimifard wrote: > Hi everybody > I have a question about hash and symbol. when I use symbol for key in > hash , it didn't for me. what is the problem ? > > (example : hash = { :odd => [ 1 , 3 , 5 ] , :even => [ 2 , 4 , 6 ] , :7 > => "chance" , "number" => 1 } ) A symbol cannot start with a number: irb(main):005:0> :7 SyntaxError: compile error (irb):5: syntax error, unexpected tINTEGER, expecting tSTRING_CONTENT or tSTRING_DBEG or tSTRING_DVAR or tSTRING_END from (irb):5 from :0 irb(main):006:0> :7y SyntaxError: compile error (irb):6: syntax error, unexpected tINTEGER, expecting tSTRING_CONTENT or tSTRING_DBEG or tSTRING_DVAR or tSTRING_END from (irb):6 from :0 Jesus.