I use Object#freeze to freeze the value of an object. I can write a function to deep-freeze a complex object structure. But neither will prevent me from assigning a new value to an object.
$O=cl()
$O.thorough_freeze
$O[:file] = "makefile" # => TypeError
$O[:commands][0] = "clean" # => TypeError
$O = "reticulate" # => TypeError
In C I say
int const * const ptr = argv;
How can I thoroughly freeze an identifier?
There isn’t a way to do this. If a variable is a constant (starts with a capital letter) then you will see a warning if you attempt to reassign it but the reassignment will still take place. e.g.