lua-users home
lua-l archive

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

David Given wrote:
Hmm. If I'm *not* using globals, can I assign nil to _ENV to get runtime errors if I tyop the name of a local?

local string_len = string.len
_ENV = nil
a = 5 -- oops, forgot to local this

What about functions? If I understood correctly, they too will be defined as fields of _ENV, as currently happens with _G.

(but I'm not sure I got the details right)