lua-users home
lua-l archive

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


On Wed, Mar 3, 2010 at 2:51 PM, Luiz Henrique de Figueiredo
<lhf@tecgraf.puc-rio.br> wrote:
> If you want to exchange aTable and aFunction, there's a third way:
>        lua_pushvalue(L, 1);
>        lua_pushvalue(L, 2);
>        lua_replace(L, 1);
>        lua_replace(L, 2);

I've always missed a simple swap the top two elements operation, personally