lua-users home
lua-l archive

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


2018-03-19 21:08 GMT+02:00 Roberto Ierusalimschy <roberto@inf.puc-rio.br>:

> More concretely, I propose a little experiment: suppose that Lua raises
> a run-time error for every assignment of nils to tables except in
> explicit assignments with a constant nil (t[k]=nil). How frequently this
> error will occurr without hinting a hidden bug in the code?

Including, of course, var=uninit where "var" is global and "uninit" is
an uninitialized global?

My first reaction was that it occurs often, but then I realized that
the cases where I would do that, the target would be an upvalue or a
local — if it is a global, it is likely to be a typo.

Yes! Give us that error!