matz / netlab.co.jp (Yukihiro Matsumoto) writes:

> It used to give a error before.  But it was not good for
> 
>   * interactive programming, e.g.

>   * reloading files, evaluate program fragment by eval.


I think the concept of a constant is an important one--constants are
used to hold values that are significant to some piece of
code. Allowing them to be silently changed undermines our confidence
in that piece of code.

Personally, I feel the damage done by an altered constant is far more
severe than the inconvenience of the above two cases.

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

  area = Math::PI * r * r

That way, you make it explicit that you _meant_ to make the change.

Regards

Dave