I think this was covered before, but it came up again today when I was talking about recompiling code from a string:
Lua 4.0 has a function called lua_dostring() which executes a string, treating it as Lua code.
Lua 5.0 mentions (near the bottom of the manual) that ''dostring is deprecated. Use loadstring instead''. But there is no loadstring (or lua_loadstring) in the C API. I''m assuming you use lua_load() and that the mention of loadstring in the manual was just a mix-up.
lauxlib.h provides lua_dostring() in the Compatibility section so I assume you can still use that anyway, it seems. Does anybody know if my theory is right though?
[ MSVC Fixes | STL Docs | SDL | Game AI | Sockets | C++ Faq Lite | Boost
Asking Questions | Organising code files | My stuff | Tiny XML | STLPort]
Lua: lua_dostring, loadstring, lua_load, etc
March 19, 2004 02:51 PM
The mention in the manual about loadstring refers to Lua code.
You should use lua_load instead of lua_dostring in C code.
You should use lua_load instead of lua_dostring in C code.
Yeah, that would make sense, except that it''s a bit nonsensical to say that a Lua function can make a C API function deprecated. Oh well.
[ MSVC Fixes | STL Docs | SDL | Game AI | Sockets | C++ Faq Lite | Boost
Asking Questions | Organising code files | My stuff | Tiny XML | STLPort]
[ MSVC Fixes | STL Docs | SDL | Game AI | Sockets | C++ Faq Lite | Boost
Asking Questions | Organising code files | My stuff | Tiny XML | STLPort]
March 22, 2004 08:53 AM
I''m told there''s a luaL_dobuffer (or something, note the "L" utility function, but I haven''t checked this out yet.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement