lua-users home
lua-l archive

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


   Hi... Something strange is happening with the following code:

test.cpp:
extern "C" {
#include <lua.h>
#include <lualib.h>
#include <lauxlib.h>
}

int main (int argc, char ** argv)
{
 lua_State* L = lua_open();
 luaopen_base(L);
 return lua_dofile(L,"test.lua");
}

test.lua:
xxx,yyy = dofile()
print(xxx)
print(yyy)

   I type "return 1,2,3,4,5" and i see on the stdout "2" followed by "3"...
   If i type "return 2,3,4,5", i see 3 followed by 4...
   Is this expected? I expected the first two arguments to be printed...
   If i type "return 1,2", I see "2" and "nil"...
   Any help will be appreciated...
   Thanks
   -- Fred