lua-users home
lua-l archive

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


> I only have 1 upvalue in this case (though at times I might have 2); I had
> assumed this would return NULL, but it doesn't seem to do so reliably.

This is not reliable at all; it is not even implemented ;-)  Lua assumes
that you know how many upvalues you have before accessing them.

You can use the debug API to know the number of upvalues of a function
(although we do not recomend the use of debug facilities in "normal"
code), or else use Daniel Remar's sugestion.

-- Roberto