lua-users home
lua-l archive

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


[ ... clarification details skipped ... ]


> Hope this helps a bit in your experiments.

Yeah, that helps a lot, thanks!

I've came up with this:

function sandbox(env, f, ...)
	local g = getfenv(f)
	setfenv(f, env)
	local retval = f(unpack(arg))
	setfenv(f, g)
	return retval
end

Seems to work just fine. Thanks again, Wim!

-- 
Regards, max.