Lua 命名规范
2016-01-12 15:09
513 查看
Lua和C一样,支持字符、下划线和数字(数字不能在开头)。
除此之外,lua有些特殊的要求,如:下划线后面不能接一个或多个大写单词,这是lua有特殊用途的。
下面这些是lua保留的关键字,也不能使用:
and break do else elseif
end false goto for function
if in local nil not
or repeat return then true
until while
lua中的注释用双横线来表示,如
多行注释是这样的:
如果想取消语句块的注释,只需要在第一个–[[前面加-使得第一个–[[和最后一个–]]都只是普通的单行注释。如:
除此之外,lua有些特殊的要求,如:下划线后面不能接一个或多个大写单词,这是lua有特殊用途的。
下面这些是lua保留的关键字,也不能使用:
and break do else elseif
end false goto for function
if in local nil not
or repeat return then true
until while
lua中的注释用双横线来表示,如
[code]--这是单行注释
多行注释是这样的:
[code]--[[ print(10) -- no action (commented out) --]]
如果想取消语句块的注释,只需要在第一个–[[前面加-使得第一个–[[和最后一个–]]都只是普通的单行注释。如:
[code]---[[ print(10) --> 10 --]]
相关文章推荐
- Lua chunk(程序块)
- Lua 运行你的第一个HelloWorld
- leetcode——Evaluate Reverse Polish Notation 求算式值(AC)
- [LeetCode] Evaluate Reverse Polish Notation, Solution
- Lua脚本语言简明入门教程
- Lua & C 交互 3 c/c++调用lua
- Lua & C 交互 2 尝试操作lua栈
- Lua & C 交互 1 环境搭配
- luci 打印函数封装
- Lua 与C 交换 第一篇
- Lua中的模块与module函数详解
- Lua模块和模块载入浅析
- Lua协同程序coroutine详解
- lua里面求int数组的union,diff,inter,distinct 方法实现
- Lua函数闭包解析
- lua学习笔记
- lua -- encode and decode
- Lua学习笔记6:C++和Lua的相互调用
- Lua学习笔记9:多文件
- lua内存泄露