[MacRuby-devel] [macruby] #65: #sub!, #gsub!, and other bang methods mutate frozen strings

macruby ruby-noreply at macosforge.org
Wed May 28 16:48:52 PDT 2008


#65: #sub!, #gsub!, and other bang methods mutate frozen strings
--------------------------------+-------------------------------------------
 Reporter:  binary42 at gmail.com  |        Owner:  lsansonetti at apple.com
     Type:  defect              |       Status:  reopened             
 Priority:  minor               |    Milestone:                       
Component:  MacRuby             |   Resolution:                       
 Keywords:                      |  
--------------------------------+-------------------------------------------
Comment (by lsansonetti at apple.com):

 Good catch! #gsub! indeed does mutate the frozen string.

 {{{
 $ ./miniruby -ve 's="foo";s.freeze;s.gsub!(/./,"x");p s'
 MacRuby version 0.2 (ruby 1.9.0 2008-05-17) [universal-darwin9.0]
 "xxx"
 $
 }}}

-- 
Ticket URL: <http://ruby.macosforge.org/trac/ticket/65#comment:3>
macruby <http://ruby.macosforge.org/>


More information about the MacRuby-devel mailing list