[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: statics in Lua
- From: lhf (Luiz Henrique de Figueiredo)
- Date: Mon, 20 Jul 1998 15:40:46 -0300
On second thought, here is a better solution:
local T={x=10,y="lua"}
function Set(x,y) %T.x=x %T.y=y end
function Get() return %T.x,%T.y end
The idea is to save all "static" variables as fields in T.
Then, any functions can communicate via T.
And each chunk can have its own pritave tables of statics.
When the chunck ends, the variable is gone but not its value!
--lhf