A use case for an ordered hash

That should have probably read:

m = [:a => 'a'] # m is for map. I could go for this term too as it
has brevity.
=> [:a => 'a']

m[0]
=> [:a => 'a'] # m remains as an associative array.

m[:a]
=> 'a' # and m becomes an explicit hash.

m[0]
=> {:a => 'a'} # m becomes an associative array.
or
=> [:a => 'a'] # conversion before or after?

m[:a]
=> 'a' # m becomes a hash again.

m[[0]]
=> 'a' # m becomes an associative array.

thoran@thoran.com wrote:

That should have probably read:

m = [:a => 'a'] # m is for map. I could go for this term too as it
has brevity.
=> [:a => 'a']

m[0]
=> [:a => 'a'] # m remains as an associative array.

m[:a]
=> 'a' # and m becomes an explicit hash.

m[0]
=> {:a => 'a'} # m becomes an associative array.
or
=> [:a => 'a'] # conversion before or after?

m[:a]
=> 'a' # m becomes a hash again.

m[[0]]
=> 'a' # m becomes an associative array.

Again, interesting... but what if your keys are integers? Or arrays?

Hal