lua-users home
lua-l archive

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


It was thus said that the Great Sean Conner once stated:
> 
> If you don't want to return the new table, then do:
> 
> 	lua_pushinteger(L,A.a);
> 	lua_setfield(L,1,"a");
> 	lua_pushinteger(L,A.b);
> 	lua_setfield(L,1,"b");

  You need to add one of the two lines for this to work (just noticed a
bug):

	lua_pushvalue(L,1);

	lua_settop(L,1);

  There are other ways to put the passed in table into position for
returning, but these two lines are the quickest.

  -spc