From: Philip Mateescu Date: 2002-06-05T03:41:16+09:00 Subject: When should actually freeze work ? Hi, I have the following cases where I thought freeze should work. It doesn't, and I have no clue as to why... (in all cases assignment seems to cancel the values). 1. s = "abc" s.freeze s.frozen ? # >> true s = "123" # doesn't throw a can't modify frozen string. why ? s.frozen? # >> false (but I thought I told it to freeze :) 2. s = "abc" t = "123" s.freeze #s="abc", frozen; t="123", !frozen t = s #s="abc", frozen; t="abc", frozen t = "123" #s="abc", frozen; t="123", !frozen s = t #s="123", frozen; t="123", !frozen 3. i = "50" 1.upto(5) { |i| puts "i=#{i}" } All 3 cases under version 1.7.2 (both cygwin and windows). Thanks a lot, philip