lua-users home
lua-l archive

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


> The manual doesn't say that non-acceptable indices should return NULL.

In my opinion it does.

"If the value at the given acceptable index is a full userdata,
returns its block address. If the value is a light userdata, returns
its pointer. Otherwise, returns NULL"

This english compiles into pseudo-code

if valid(index) and valueat(index) == userdata then return block address
elseif valid(index) and valueat(index) == light userdata then return pointer
else return NULL.

So an invalid index returns NULL.