lua-users home
lua-l archive

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


> On Thu, Jul 5, 2012 at 9:27 PM, Roberto Ierusalimschy
> <roberto@inf.puc-rio.br> wrote:
> > strings, not being arbitrary, can be used inside any kind of literal in
> > Lua ('...', "...", [[...]]) and also in comments without any problems.
> 
> But identifiers (in particular) cannot be done in Greek[1], say. Lua
> 5.2 tightened the acceptable characters in identifiers?

Yes, but even in old versions you could not use Greek letters in
identifiers using UTF-8. Old versions used ctype, that strongly assumes
that each character is a single byte (and needs that assumption to check
whether characters are valid in identifiers).

LuaJIT has a different approach; it accepts any non-ascii character in
identifiers. That is a simple rule and allows letters from any language,
but it also allows some abuses:

>print(−4)
nil
>print(−4∗3*3)
stdin:1: attempt to perform arithmetic on global '−4∗3' (a nil value)


-- Roberto