lua-users home
lua-l archive

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


What is the expected behavior if one indexes a table with a nil key? I had
thought it was to throw an exception. In fact I feel I've seen an exception
get thrown but maybe not. Now, however, I seem to be getting back nil.

The manual says that nil is an illegal key.

I certainly prefer the definition that says that t[ nil ] is always equal to
nil for any valid table. I just didn't realize that was the case.

Mark