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

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.

主站蜘蛛池模板: 瓮安县| 博客| 红原县| 兴城市| 邯郸县| 古浪县| 汶川县| 休宁县| 西和县| 米林县| 台安县| 红河县| 闽清县| 明光市| 思南县| 郴州市| 渭源县| 安庆市| 洪湖市| 延安市| 新竹县| 上饶县| 韶山市| 通江县| 高雄县| 乌苏市| 河北省| 平度市| 山西省| 海兴县| 巩留县| 天水市| 陵水| 板桥市| 施秉县| 邵武市| 内丘县| 阿图什市| 沁水县| 元谋县| 云安县|