From: Dmitry Bilunov Date: 2007-08-08T18:37:00+09:00 Subject: Re: non-constant strings Eric Hodel wrote: > On Aug 7, 2007, at 14:41, Dmitry Bilunov wrote: >> Hello. Why does Ruby have non-constant strings? It seems there is a >> way >> to bypass object encapsulation paradigm and break object integrity. > > Ruby lets you shoot yourself in the foot. > > http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/79333 > >> Is there a way to disable such behaviour ($SAFE will not help, >> because internal class methods will not be able to change instance- >> variable strings too). > > Nope. > > You can search the mailing list archives for further discussion on > the mutability of strings: > > http://blade.nagaokaut.ac.jp/ruby/ruby-talk/index.shtml Thanks. Mailing list discussion has exactly what I was looking for - the explanation of the reason Ruby has mutable strings. -- Posted via http://www.ruby-forum.com/.