lua-users home
lua-l archive

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


> > I thought it was legal to assign nil to existing keys inside a loop.
> > Are there further caveats that need to be observed in Lua 5.1?
> 
> file lgc.c line 65:
> 
>     static void removeentry (Node *n) {
>         setnilvalue(gval(n));  /* remove corresponding value ... */
> >       if (iscollectable(gkey(n)))
> >           setttype(gkey(n), LUA_TNONE);  /* dead key; remove it */
>     }

That exact code is called removekey in lgc.c in Lua 5.0.2.

Josh