From: Austin Ziegler Date: 2006-05-06T01:19:57+09:00 Subject: Re: Constant in Ruby. On 5/5/06, Charlie wrote:> Thank you everyone for your input. I got this simple example to share:>> A = 10 => 10> X = A.freeze => 10> A = 20 => 20> X => 10 I'm not really sure you're understanding what was said. Line 2: X = A.freeze Does nothing except assignment. 10.freeze does nothing. That's what A.freeze actually does. Assignment changes the reference for a particular variable. x = "foo" a = x x.gsub(/foo/, "bar") a # -> "bar" x = "foo" a = x x = "bar" a # -> "foo" This is true whether you're dealing with variables or constants. -austin--Austin Ziegler * halostatue@gmail.com * Alternate: austin@halostatue.ca