From: Nikolai Weibull Date: 2005-03-17T06:00:46+09:00 Subject: Re: Symbol vs String * Sebesty�n G�bor (Mar 16, 2005 21:40): > Just a dumb question: what is the real difference between { :aKey => > "aValue" } and { "aKey" => "aValue" } ? I know the first key is a > symbol the latter is a string. I like string keys why should I use > symbols? Why symbols worth to use as keys? Thanks, Always use symbols for situations like these. The reason is that a symbol is immutable and also that no new string needs to be created for it if used more than once. Also, using strings as symbols and then having the string altered will force a rehash of the table. It's all about memory savings and execution speed, nikolai -- ::: name: Nikolai Weibull :: aliases: pcp / lone-star / aka ::: ::: born: Chicago, IL USA :: loc atm: Gothenburg, Sweden ::: ::: page: www.pcppopper.org :: fun atm: gf,lps,ruby,lisp,war3 ::: main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}