lua-users home
lua-l archive

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


Thomas A. Schmitz wrote:
> On Sep 18, 2007, at 5:31 AM, Patrick Donnelly wrote:
> subs = {
> a = "α",
> b = "β"
> }
> 
> etc. But as soon as I try to stick some non-alphanumerical characters
> in there like so: 
> 
>  >~h| = ᾖ
> 
> I get errors. Is it impossible to have keys to an array that are of
> this form, or am I missing something obvious? 

With that syntax, the right string must be quoted, and the left string must be a valid Lua symbol. You cannot put characters '>', '~' in a Lua symbol. Precisely which characters are authorized in the symbols is local dependent.

You can also try this alternative syntax:

subs = {
  [">~h|"] = "ᾖ"
}