From: "normalperson (Eric Wong)" Date: 2013-10-09T06:17:04+09:00 Subject: [ruby-core:57742] [ruby-trunk - Feature #8998] string keys for hash literals should use fstrings Issue #8998 has been updated by normalperson (Eric Wong). File hash_aset_fstring.diff added Proposed patch to partially implement this, but I get segfaults (backtrace/dump coming) with "make check". There probably needs to be some RGenGC-related calls/fixes for this. Note: this patch does not avoid the short-lived, unfrozen string literal. I don't currently know the parser/compiler code well enough to make that optimization. ---------------------------------------- Feature #8998: string keys for hash literals should use fstrings https://bugs.ruby-lang.org/issues/8998#change-42345 Author: normalperson (Eric Wong) Status: Open Priority: Low Assignee: Category: core Target version: current: 2.1.0 While we're introducing optimizations from frozen strings, string keys inside hashes should be frozen at the compiler level to prevent duplication. a = { "ABC" => :t } b = { "ABC" => :t } # the following ought to print true p(a.keys[0].object_id == b.keys[0].object_id) This should introduce no incompatibilities and be transparent to users of older rubies. -- http://bugs.ruby-lang.org/