lua-users home
lua-l archive

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


Hi,

The implementation always returns nil if the key is nil (check luaH_get 
in ltable.c).

--
Fabio Mascarenhas

On Fri, May 19, 2006 at 02:06:00PM -0700, Mark Hamburg wrote:
> 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
> 

Attachment: signature.asc
Description: Digital signature