[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: how to call lua scripts from C/C++ without recompiling each time?
 
- From: Kevin Meinert <kevin@...>
 
- Date: Tue, 2 Sep 2003 11:34:44 -0500 (CDT)
 
Thanks Peter, the code at 
http://lua-users.org/lists/lua-l/2003-07/msg00082.html is very similar to 
what I'm (now) doing with ref and getref, except my version of lauxlib in 
lua 5.0 doesn't have the luaL_ versions of ref and getref (only the lua_ 
versions for 4.0 compatibility defined in lua.h).
I'll switch my code to use rawgeti instead, to avoid using the auxlib.
Any idea where luaL_ref is defined?  is it in CVS only?  or has 5.0 
changed since I last got the 5.0 tarball?  I didn't see a CVS link to try 
to find it there.
kevin
On Tue, 2 Sep 2003, Peter Shook wrote:
> 
> This may help:
> 
> http://lua-users.org/lists/lua-l/2003-07/msg00293.html
> 
> - Peter
> 
> 
> Kevin Meinert wrote:
> 
> > In my game engine, I'm loading lua scripts using luaL_loadfile, then, to 
> > execute, I run lua_pcall.  If I execute the script again with lua_pcall, 
> > it fails unless I call luaL_loadfile again before lua_pcall...
> > 
> > I'm trying to avoid recompiling everytime I run a script, I'd like to run 
> > pure bytecode each time.
> > 
> > So, what I'm trying to use is lua_ref and lua_pushref, but lua_pushref 
> > isn't defined in my copy of the 5.0 code from lua.org.  I'm not even sure 
> > this will work, but it looked promising.
> > 
> > 
> > Any ideas how to call lua scripts from C/C++ without recompiling each 
> > time?
> > 
> 
-- 
*--*---*---*----*-----*------*------*-----*----*---*---*--*
Kevin Meinert                         /_/                  
home - http://www.vrsource.org/~kevin           \        / 
music - http://www.subatomicglue.com           \/  __    \/
                                                   \__     
                                            \_\