lua-users home
lua-l archive

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


On 11/17/2012 03:47 AM, Dirk Laurie wrote:
Lua has no variables (i.e. preallocated named blocks of memory
the contents of which may change), only names and values. Lua names
are not independent entities. They are indices into the global
environment. The following statements do the same:

     a = b/c
     _ENV.a = b/c
     _ENV["a"] = b/c

I.e. all Lua assignments involve a table,
Except for local variables, including function parameters, for-loop variables, etc.

and you can intercept
those assignments
Except for above-noted cases. Not that I'm in favor of lexical typing, but the metamethods aren't a _complete_ replacement.