Thank you very much to all of you for your precise answers and nice examples, it is perfectly clear for me now.
De: "Tim Hill" <
drtimhill@gmail.com>
À: "Lua mailing list" <
lua-l@lists.lua.org>
Envoyé: Mercredi 13 Août 2014 00:47:20
Objet: Re: Accented variable names
Any string (and any other value as well except nil) can be used as a table key so, as you note, table[“caché”] is perfectly valid. As a convenience, Lua provides syntactic sugar when the table key is a valid identifier, allowing you to use table.foo as shorthand for table[“foo”]. However, caché is NOT a valid identifier, and so of course you cannot use the shorthand syntax for table indexing in this case. This is also true for many other strings, for example table[“12”] is valid (and quite different from table[12] of course), but table.12 is not.
—Tim