lua-users home
lua-l archive

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


On Tue, Aug 12, 2014 at 6:34 PM,  <astient@laposte.net> wrote:
> Sorry, i forgot to ask you why in this case Lua accept this way to define
> identifiers with an accent:
>
> table={}
> table["caché"]="test"
>
> isn't this way equivalent to: table.caché="test" ? However the first one is
> accepted (i can do a print of table["caché"]) but the second gives an error
> as you explain.
>

Really, it's the other way around: table.caché="test" is shorthand for
table["caché"]="test". In the latter syntax, caché is a string
literal, so it can have any characters inside. In the former, it's an
identifier, so it's limited to certain characters.

-- 
Sent from my Game Boy.