putting away HashWithIndifferentAccess

why the lucky stiff why at whytheluckystiff.net
Wed Sep 26 00:10:17 EDT 2007


On Tue, Sep 25, 2007 at 05:05:04PM -0700, MenTaLguY wrote:
> Ah, yeah, good catch.  Actually any approach which let you access
> query parameters as methods would have that problem -- behind the
> scenes, every uniquely named method introduces a symbol.  This is
> even a potential issue for approaches using method_missing, since
> in MRI, rb_call wants an ID (normally obtained via rb_to_id).

Right, okay.  Well the current approach uses method_missing.

I say we just go with Hash and then have a specific option for using
HashWithIndifferentAccess.  I like this alot better, because it
means you can just set the option and things work just like 1.5 and
backwards.

  Camping.goes :Tepee
  Tepee.include HashWithIndifferentAccess
  Tepee.include Markaby

Err... or something.

Let's use Strings for Hash keys, since HWIA uses Strings internally,
which is likely to be nicer for ActiveRecord and because of symbol 
memory concerns, lastly.

_why


More information about the Camping-list mailing list