G
Gavin Sinclair
The following statement, free of all context, generates an error:
x # NameError: undefined local variable or method `x' ...
So does this one:
x = y # NameError: undefined local variable or method `y' ...
However, this one does not (again, free of all context):
x = x
x # nil
This, to me, is inconsistent and undesirable behaviour. I would
prefer this:
x = x # NameError: undefined local variable or method `x' ...
I haven't given it much thought, but the existing behaviour cost me 15
minutes debugging, and I:
* don't see a benefit of the existing behaviour;
* do see a benefit (consistency) of changing the behaviour.
Any comments?
Gavin
x # NameError: undefined local variable or method `x' ...
So does this one:
x = y # NameError: undefined local variable or method `y' ...
However, this one does not (again, free of all context):
x = x
x # nil
This, to me, is inconsistent and undesirable behaviour. I would
prefer this:
x = x # NameError: undefined local variable or method `x' ...
I haven't given it much thought, but the existing behaviour cost me 15
minutes debugging, and I:
* don't see a benefit of the existing behaviour;
* do see a benefit (consistency) of changing the behaviour.
Any comments?
Gavin