lua-users home
lua-l archive

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


> If you dive into the source code of lua.c, and see how it calls the
> luaL_openlibs you will found that it has no special environment
> prepared for luaL_openlibs.

The environment is part of the lua_call: luaopen_* are called in the current
Lua environment.

> The advantage of not touching linit.c is: you will never need to
> compile lua source code again and you can even remove lua source code
> from your project. Just keep a static library of lua is enough.

Exactly my point. Use your own copy of linit.c in your C project.
 
> So IMO you can freely modify lua.c.

Sure. My point is just that if you only need to change the set of libraries
loaded by your host or by lua.c, it's much easier to maintain a copy of linit.c.