The code doesn't behave incorrectly but I'm wondering why the warning shows up if I run it twice?
module Languages FAVE = "Ruby" # This is what you typed before, right? :D end
Throws "(ruby):1: warning: already initialized constant FAVE"
if I hit ctrl-enter twice. But shouldn't constants be cleared each time we run the script? I mean, we can use remove_const(:FAVE) but why should we have to? Constants in other languages don't show this behavior. At least not as I understand them. It seems that if someone unknowingly runs another script, they'll throw this error, and the downsides outweigh the benefits for programming, nuisance warning errors, etc.
I sense I'm missing a big concept here. What is it?