[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: UTF-8 identifiers [was: Re: Lua t-shirts]
- From: Philippe Lhoste <PhiLho@...>
- Date: Mon, 05 Oct 2009 13:26:38 +0200
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 Lua.org live demo but I still can't change the locale.
Perhaps I am doing something wrong?
--
Philippe Lhoste
-- (near) Paris -- France
-- http://Phi.Lho.free.fr
-- -- -- -- -- -- -- -- -- -- -- -- -- --
- References:
- Lua t-shirts, Stuart P.Bentley
- Re: Lua t-shirts, Pierre LeMoine
- Re: Lua t-shirts, Roberto Ierusalimschy
- Re: Lua t-shirts, Patrick Donnelly
- Re: Lua t-shirts, Phoenix Sol
- Re: Lua t-shirts, Stefan
- Re: Lua t-shirts, Peter Cawley
- Re: Lua t-shirts, steve donovan
- Re: Lua t-shirts, David Given
- UTF-8 identifiers [was: Re: Lua t-shirts], Ico
- Re: UTF-8 identifiers [was: Re: Lua t-shirts], Jerome Vuarand
- Re: UTF-8 identifiers [was: Re: Lua t-shirts], David Given