lua-users home
lua-l archive

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


Luo Hei wrote:
> Terry Bayne escribió:
>> The way I usually do this is to embedded the functions in the host application, and then register those functions with the Lua engine.  That way they are available for all scripts and are "pre-loaded".
>> 
> You mean writing the functions in C?  I think it is not a solution. The 
> functions must be written in Lua. At least, I think so.
> Perhaps I can put all functions in a file and execute it before all 
> other scripts?

You may need a little bit of C for this approach, but your functions
are still all written in Lua.  Heree's a message describing what I do
(note that this is for version 5.0):

http://lua-users.org/lists/lua-l/2007-04/msg00674.html

Robby