lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

> My other pet hate is the way things get automatically
> cast to fit the situation.

Me too. I always do explicit casts to show what I mean, and automatic
coercion makes the VM (slightly) more complex than it needs to be. Even
for naive users, the error message that you've supplied a number where a
string was required or vice versa is easy to understand and easy to fix;
it's also easy to give some examples that shows why it's desirable not to
make this automatic. Where automatic conversion is desirable, it can be
done by the program (so that you don't need to put "tostring" and
"tonumber" in config files, for example).

-- | Analogy is a midwife, identity a murderer