Leon Timmermans <fawaka <at> gmail.com> writes: >[cases where evaluating ($b + 0) changes the value of a later expression] >I think the real bug here is not that a scalar value can have both a >numeric and a string value, but that some operators and keywords are >polymorphic on the representation of the value. Well, perhaps. But practically, I do not suggest changing either of those things. It is not a problem that a scalar can have both a numeric and a string value. What is wrong is that the scalar can somehow be altered just by using it in an expression, without assigning to it or using any other explicit mutation operator. Its values, whatever they may be, should stay the same when you just read it. From a practical point of view, changing all the operators which depend on the representation of a value might be a big task, but changing ($b + 0) so that it just looks at the value of $b, but doesn't alter it, seems like a smaller fix. -- Ed Avis <eda@waniasset.com>Thread Previous | Thread Next