I have several important questions regarding lua
first
I have always wondered if you always have to release the local variables by using nil
for example , I have a code where a local variable is made within a function
local realx = 10
local function dosth()
local x = 13
realx = x
--(x = nil) is this necessary???
end
second
in C a function is usually ended when return is called however in lua it doesn’t seem like it
when I make a function like this
local function dosth()
local count = 0
timer.performWithDelay(1000,function() print(count…“seconds”) end,50)
return 0
end
I belive the local variable count still remains in memory even after return is called how does this work?