lua-users home
lua-l archive

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


I just saw the recent posts on LuaCheia about "setglobals() and
C-Functions" -- the Import solution is clearly superior to allowing C
modules to write the global namespace.
http://www.lua.org/notes/ltn011.html

Import provides a table to the module where the module puts its
bindings. So, the users can put the bindings in whatever "packages"
they want, including temporary/local ones.

e

Friday, February 28, 2003, 5:24:44 PM, you wrote:

> From: "Doug Currie" <e@flavors.com>
>> Wouldn't it be nice if the binary module semantics were the same as
>> import semantics? This would make binary modules less dependent and
>> less intrusive on a global name space. [Binary modules don't usually
>> have the circular dependencies problem.]
>>
>> Also, this would also make it possible for import to work with either
>> Lua or binary code. Should the user care how the import module is
>> implemented?

> Well, we are trying to tackle something like this with the LuaCheia project.
> A 'module' should be transparently loadable by the 'user' w/o any need to
> know if it is binary, script or otherwise...

> -Martin