From: Christoph Date: 2002-08-26T22:06:16+09:00 Subject: Re: warning modifying constant & 'global constant' "David Garamond" wrote in .... > thanks matz. > > i want to protect some global variables without having to resort to > setting $SAFE to 4. can we use some proxying mechanism, or override an > object method to trap assignment/binding? freeze() only protect the > object value, and does not prevent rebinding. Actually freezing a class as a similar effect on its class, local variables and constants --- class A @@var = 3 @var = 2 Var =1 freeze # for example p @@var # raises a TypeError ... end --- /Christoph