lua-users home
lua-l archive

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

>AFAICT from the sources socket/
>can already statically link the so file to your lua >interpreter. All you have to modify is lua.c so 
>that it puts preload

What I am suggesting is a little different, viz: that the TCP/UDP core of LuaSocket be made into a package which can be require()d independently (and in advance of) the higher-protocol-level code in socket.lua and others.

At the moment, if you statically link the C core and call luaopen_socket_core() then you end up with a loaded package called 'socket' containing a subset of LuaSocket. This is great, except that you can't then decide to load the higher level stuff because when you require('socket'), nothing happens because 'socket' is already loaded :-)

socket/ could, IMO, perfectly usefully be a package in its own right. You could then load the higher-level Lua or not to suit yourself.