lua-users home
lua-l archive

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


In message <fc.00758246000d6e4f3b9aca002ce8bba7.d6f5a@blackpoolsixth.ac.uk>, "A
ndy Stark" writes:
> 
> There are other ways. You can index a table by any value, so we could have
> a convention where the nil value, say, could be used as the index for the
> XML tag:-
> 
> xmlRoot = {[nil]= "person"...}

Unluckily you chose the one value that cannot be used to index a table.
nil cannot be used to index a table.

But you could create a nonce and use that.  Something like:

tag = function()end

or (more profligately?)

tag = {}

Cheers,
 drj