lua-users home
lua-l archive

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


Hallo

I have this problem: In my program I have a small script which is entered by the user at runtime. I then execute that script MANY times, but I don't want do do MANY lua_dostring, since this would "recompile" the script every time. It would be nice to have a way to translate the script only once, with an hypothetical lua_compilestring, and then call lua_dobuffer. How can I do this? At the moment I'm using a temporary file, and calling luac via fork, execve, wait (I'm using linux), etc. Is there some better way? (I also thought about putting the script into a lua function, lua_dostring only once and then call the function when needed)

Thanks

Oscar Lazzarino