[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: newbie question: is globals() usable in practice ?
- From: Benoit Germain <bgermain@...>
- Date: Tue, 2 Jul 2002 18:21:34 +0200
Hello all,
here is a little snippet, executed under W2K with lua-40 patched with the
latest bugfixes:
-- start globals.lua
do
a="yo"
print(a..1)
local t = {}
print(a..2)
local prevg = globals(t)
print(a..3)
globals(prevg)
print(a..4)
end
-- end
and here is the output:
C:\>lua globals.lua
yo1
yo2
C:\>
It looks like as soon as the globals table is swapped, execution stops. Why
is that ? Is this a normal behaviour, and if so, what is the practical use
of the globals() function ?
Regards,
Benoit.