On 11.02.2008 22:58, J. Cooper wrote:
> Alright, so in general if the hash is going to interact with the outside 
> world, I should use string keys, and it's not worth it particularly to 
> worry about handling mismatch (unless I'm embarking on a Rails-sized 
> framework)?

I am not sure what you mean by "handling mismatch".  If by mismatch you 
mean access with symbols and strings: I usually do not worry about this,
because I write the code that puts data into the Hash and reads it - so 
I know what happens or can control.  Personally I prefer uniform access.

If by "outside world" you mean, a "data source that you do not control" 
(e.g. web server logfiles, CSV data) then yes, in those cases I would 
use Strings, namely the strings I read from that source.

> I guess I had figured symbols made more sense, as a key is kinda just an 
> identifier and there isn't a reason to perform string functions on it. 
> But I didn't realize the deal with the GC

Well, if there is a limited set (e.g. states of an object like :open and 
:closed for an IO stream) then it makes perfectly sense to use symbols.

Kind regards

	robert