lua-users home
lua-l archive

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


I guess you are right JC, maybe I will just do a simple "dofile" and worry with performance after. But knowing that it has some way around to increase performance in a easy way is very important.  I had already faced problems that were easier to start allover again than to optimize in the way things were implemented.

GrayFace, I do not get it... do you mean one script with a table where every script would register its own function? And would it really solve the problem? 

What do you all think of the following solution:
int luaL_ref (lua_State *L, int t)
the last function could be used to get the script that was read and loaded by lua_loadfile(), and after that I can insert the reference returned by luaL_ref in a hash table where I can late access to retrieve the reference and pass to the function lua_rawgeti(L, t, r), so that my function get inserted into the stack again and that I can call it again with pcall without the need to load!

What do you think of that?