In message "[ruby-talk:01095] Re: YADQ (Yet Another Dumb Question)"
on 00/01/11, Dave Thomas <Dave / thomases.com> writes:
|So... how about a compromise? We could have a global method, say
|'unset <list>', that unsets all the variables in it's list. That way,
|if you want to redefine a constant, you could:
|
| module Math
| unset PI
| PI = 2
| end
You can accomplish it by remove_const method
module Math
remove_const :PI
PI = 2
end
But it requires knowledge about the constants to overwrite. For
example, to reload the program without error, you have to remove all
constants defined in the program before loading it.
I'm not sure what is the best way.
matz.