Created
December 12, 2011 14:40
-
-
Save bittersweet/1467545 to your computer and use it in GitHub Desktop.
autovivicating hash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def autovivicating_hash | |
Hash.new {|ht,k| ht[k] = autovivicating_hash} | |
end | |
x = autovivicating_hash | |
x["a"]["b"]["c"] = 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment