Skip to content

Instantly share code, notes, and snippets.

@ddebernardy
Last active December 29, 2015 06:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ddebernardy/7629298 to your computer and use it in GitHub Desktop.
Save ddebernardy/7629298 to your computer and use it in GitHub Desktop.
Breaking Ruby hashes with mutable keys
>> k = {}
=> {}
>> h = {k => :v}
=> {{}=>:v}
>> k[:broken] = :yes
=> :yes
>> h
=> {{:broken=>:yes}=>:v}
>> h[k]
=> nil
>> h[{:broken=>:yes}]
=> nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment