[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: string freeze

Harry

4/24/2007 1:05:00 AM

On 4/24/07, Stephen Smith <4fires@gmail.com> wrote:
> Hey all,
>
> So I'm trying to freeze a class variable, and I discover that Object#freeze
> breaks down every time on my machine. Even with simple strings.
>
>
> fiery
>

Try altering it instead of reassigning it.
I think this is a little more like what you expected.
Not exactly, but you can see freezing.


test = "good"
p test
test.freeze
p test
p test.frozen?

test << "bad"
p test
p test.frozen?

Harry

--
http://www.kakueki.com/ruby...
A Look into Japanese Ruby List in English