lua-users home
lua-l archive

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

On 05/10/2009 12:05, David Given wrote:
It shouldn't be!

It is here from the start, and documented:

"Lexical Conventions: (The definition of letter depends on the current locale: any character considered alphabetic by the current locale can be used in an identifier.)"

It should be using the C locale for all code-related parsing --- languages should never, ever, under *any* circumstances, change their behaviour depending on locale!

It has always been a controversial point, but in practice most users discipline themselves and stick to Ascii...

I believe the historical reason for this choice goes back when Lua was used as data metalanguage: it allows to use locale names as keys for tables:

a = { Roméo = "Juliette", César = "Brutus" }

Although I cannot test that because it seems that on Windows it defaults to C locale and refuses to change (unless I am doing something wrong).
I tried with Web Lua but it doesn't expose os table (I can understand why...).
Ah, I can do that in live demo but I still can't change the locale.
Perhaps I am doing something wrong?

Philippe Lhoste
--  (near) Paris -- France
--  --  --  --  --  --  --  --  --  --  --  --  --  --