lua-users home
lua-l archive

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


> These will certainly work but we would ideally want a value that can
> be quoted as a literal;

Why?  You can always write xmlRoot[xml.name], if xml.name is assigned the
name index you want to use and it's not any different from xmlRoot[true]
that you proposed.

> the literal should be a nice, short token if
> possible. The "{}" is certainly short, but do all empty tables have
> the same hash value? (Possibly, but it is not obvious).

Nope.  Try

    print({} == {})

Boolean true or false can be used.  You could also use the empty string ""
(which is also not a valid XML name.)

--
Wim