lua-users home
lua-l archive

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


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.