From: shibata.hiroshi@... Date: 2014-01-30T05:53:19+00:00 Subject: [ruby-core:60255] [ruby-trunk - Feature #9278] Magic comment "immutable: string" makes "literal".freeze the default for that file Issue #9278 has been updated by Hiroshi SHIBATA. Target version changed from 2.1.0 to current: 2.2.0 ---------------------------------------- Feature #9278: Magic comment "immutable: string" makes "literal".freeze the default for that file https://bugs.ruby-lang.org/issues/9278#change-44731 * Author: Colin Kelley * Status: Open * Priority: Normal * Assignee: * Category: core * Target version: current: 2.2.0 ---------------------------------------- Building on https://bugs.ruby-lang.org/issues/9042, this pull request adds the magic comment # -*- immutable: string -*- that implies .freeze on every string literal in the file. To get a mutable string in a file that starts with the magic comment, use String.new or ''.dup. Here is a corresponding github pull request: https://github.com/ruby/ruby/pull/487 For more details, background, and rationale, please see this blog post: http://development.invoca.com/magic-comment-immutable-string-makes-ruby-2-1s-literal-freeze-optimization-the-default/ -- http://bugs.ruby-lang.org/