lua-users home
lua-l archive

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


The packagemodel is very flexible, and it's very easy to write your own loaders, and fetch your source data from wherever you like. I wrote something akin to Starkit (http://www.equi4.com/starkit/index.html) using metakit to do this for the keplerproject, but I never finished it properly (I was to hell bent on completely binding metakit itself to lua).. Basically it injects it's own loader, and from then on all requires and io happen inside the db file, which can be an external file, or appended to the executable like starfish.



gary ng wrote:
What if my lua program has 'require' statements ?

I can patch linit.c to include my frequently used C
libraries(lmd5, lposix etc.) but don't know how to
include modules that is written in lua to be all
embedded into one single executable.

--- Luiz Henrique de Figueiredo
<lhf@tecgraf.puc-rio.br> wrote:

first, use luac to compile it to bytecode
second, make the byte code a C char array and
include it into your C file
third. use lua_loadbuffer to load your C string.
and last, use pcall to run it.
Or use my srlua:
http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/#srlua




____________________________________________________________________________________ Sick sense of humor? Visit Yahoo! TV's Comedy with an Edge to see what's on, when. http://tv.yahoo.com/collections/222