lua-users home
lua-l archive

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


Hello,

I'm rather new to Lua, but it looks like a good language for what I'm
doing.

In my program I have a large API I want to export to LUA, however I will
be creating and destroying the Lua context often, and registering every
function is not practical, both because of the time it takes to do so
and because the program will have the function names in a hash table
within the program already.

Is there a way of telling Lua to call a C function whenever it finds an
unknown function? That way the main program would do the lookup and
handle the function call. That, or telling Lua to ask the main program
for the symbol and a pointer to a C function whenever it doesn't find
the symbol within it's own table?

...or perhaps there is an easier way of doing this that I overlooked.


Thanks
Drirr.