lua-users home
lua-l archive

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


On Wed, Apr 9, 2008 at 3:39 PM, Eugen-Andrei Gavriloaie
<shiretu@gmail.com> wrote:
>  3. We now try to add a new value using your method. Let this value be the
> string "this is a string". lua_objlen(L, -2) + 1 evaluates to 4 in this
> case.

wrong.
lua_objlen(L, -2) is the same as #t, and it returns a number such that
t[n] is not nil and t[n+1] is nil.  in this case it could be 1 or 4,
so lua_objlen(L, -2) + 1 could be 2 or 5, both of wich are empty




-- 
Javier