lua-users home
lua-l archive

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


Also we must clearly distinguish the lifetime of a variable (i.e. its "scope" of declaration) and the lifetime of the "value" it stores (by reference if the value is an object like a table, string, userdata, function or thread, but only by copy when it is a number or nil).

When the scope is local, it cannot be used anywhere else then in the function declaring it, but its current value can be used separately (number and nil values are transmitted by separate copy, not by reference).