[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: lua globals and C code
- From: "Gordon A. Acocella" <gaa@...>
- Date: Tue, 27 Aug 2002 22:49:50 -0400
With Lua 5.0 alpha I am getting very close to being able to replace perl
with Lua for general-purpose scripting (all I need now are dynamically
loadable packages like poslib and luasocket). Anyway, it still isn't
working quite the way I had hoped. I wanted to do something like this:
poslib = {}
local f, e = loadlib("lposlib.dll", "lua_poslibopen")
if not f then
error(e)
end
setglobals(f, poslib) -- (this does not work)
f()
But, I cannot set the globals table for a C function, and if I wrap it
inside a Lua function it has no effect (all poslib functions are still
entered in the original globals table). Ideally, I would expect C
functions to have function-specific globals tables just like Lua
functions.
Are there any plans to change this? Is there a simple work around I am
missing?
Gordon