lua-users home
lua-l archive

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


if I understood this correctly, the way variables work in Lua is that they are global by default, and you explicitly declare those local that you want to be thus. Is there any place where I can find information on why it was designed this way, which is pretty much the opposite of the major languages?

So far I thought it was safer if variables are local by default, so code can't accidentally change another object's variables (e.g. during a recursive call).

-- M. Uli Kusterer