官术网_书友最值得收藏!

Assignment conventions

There are rules for variable names. A variable starts with a letter or an underscore. It can't contain anything other than letters, underscores, or digits. It also can't be one of the following reserved words of Lua:

  • and
  • break
  • do
  • else
  • elseif
  • end
  • false
  • for
  • function
  • if
  • in
  • local
  • nil
  • not
  • or
  • repeat
  • return
  • then
  • true
  • until
  • while

The following are valid variables:

  • x
  • X
  • ABC
  • _abc
  • test_01
  • myGroup

The following are invalid variables:

  • function
  • my-variable
  • 123

Note

Lua is also a case-sensitive language. For example, else is a reserved word, but Else and ELSE are two different, valid names.

主站蜘蛛池模板: 平乡县| 石柱| 正定县| 庆元县| 葫芦岛市| 专栏| 太白县| 新兴县| 邳州市| 夏河县| 长汀县| 唐山市| 长寿区| 阿巴嘎旗| 汝城县| 女性| 永康市| 水富县| 四会市| 鹿泉市| 台山市| 红桥区| 临朐县| 松溪县| 赤水市| 民勤县| 井陉县| 朝阳县| 庐江县| 石嘴山市| 博客| 宜兰市| 桃园县| 台湾省| 西宁市| 马龙县| 西畴县| 彭州市| 大新县| 金沙县| 茌平县|