From: Glenn Smith Date: 2005-04-11T19:56:24+09:00 Subject: Re: Symbols... Every day I scratch a little bit more off the surface of Ruby! Thanks guys!! On Apr 10, 2005 9:05 PM, Nicholas Seckar wrote: > On Sunday 10 April 2005 15:16, Bill Kelly wrote: > > Probably (just a guess) the @params behind the scenes is a > > hash that has keys of Strings not Symbols. If this is so, then > > in the above, :year is being converted, probably, with .to_s > > before being used as a lookup in @params hash anyway. > > You are exactly correct. (The class is called HashWithIndifferentAccess..) > > The main reason for using strings as keys for indifferent hashes is the fact > that symbols are not garbage collected. If symbols were used, then > constructing indifferent hashes with arbitrary keys would (eventually) > produce the symptoms of a memory leak. > > -- > > Nicholas Seckar aka. Ulysses > > -- All the best Glenn Aylesbury, UK