2011/4/30 Robert Klemme <shortcutter / googlemail.com>:
> On 30.04.2011 21:25, Iaki Baz Castillo wrote:
>>
>> Hi, assinging a value to a constant within a method is not allowed
>> (SyntaxError:: dynamic constant assignment) but I can use
>> self.class.const_set within a method. Which is the difference?
>
> You described the difference pretty accurately. It is quite common for Ruby
> to forbid doing bad things directly while still leaving a way to do it
> nevertheless (just think of private methods and #send).

Ok. Then one question more: why is not possible to reassing a value to
a constant (even using self.class.const_set)? Is there internal issue
with it? I get a warning doing it (I suppose it depends on $safe
value), but what is the real problem with it?

Thanks a lot.

-- 
Iaki Baz Castillo
<ibc / aliax.net>