|
On Aug 12, 2014, at 3:34 PM, astient@laposte.net wrote:
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 |