lua-users home
lua-l archive

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

> Someone correct nee if I'm wrong, but you can't, unfortunately. Local
> functions and variables are special in Lua. They're stored as numerical IDs
> internally.

My only correction is that I would use the adjective "special" the other
way around. Usually, variable names (as other identifiers in programming
languages) serve only to connect uses of something with its definition,
so it is quite usual for a compiler or precompiler to convert them to
numbers, addresses, etc. In particular, renaming a variable to another
name (of course avoiding collisions) should never change the meaning of a

What is special is global variables (in the case of Lua), which allows a
form of introspection.

-- Roberto