惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

W
WeLiveSecurity
T
The Exploit Database - CXSecurity.com
C
CXSECURITY Database RSS Feed - CXSecurity.com
S
Security @ Cisco Blogs
T
Threat Research - Cisco Blogs
TaoSecurity Blog
TaoSecurity Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
腾讯CDC
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
The Blog of Author Tim Ferriss
Microsoft Azure Blog
Microsoft Azure Blog
罗磊的独立博客
F
Full Disclosure
博客园 - 【当耐特】
C
CERT Recently Published Vulnerability Notes
Engineering at Meta
Engineering at Meta
Application and Cybersecurity Blog
Application and Cybersecurity Blog
T
Threatpost
I
Intezer
V2EX - 技术
V2EX - 技术
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The Hacker News
The Hacker News
小众软件
小众软件
Google DeepMind News
Google DeepMind News
T
Tailwind CSS Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
B
Blog RSS Feed
Microsoft Security Blog
Microsoft Security Blog
N
News | PayPal Newsroom
MyScale Blog
MyScale Blog
AI
AI
Vercel News
Vercel News
Spread Privacy
Spread Privacy
美团技术团队
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
The GitHub Blog
The GitHub Blog
V
Vulnerabilities – Threatpost
Schneier on Security
Schneier on Security
Cyberwarzone
Cyberwarzone
G
GRAHAM CLULEY
Help Net Security
Help Net Security
Hacker News: Ask HN
Hacker News: Ask HN
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
L
LINUX DO - 热门话题
U
Unit 42
L
LangChain Blog
Recent Announcements
Recent Announcements

博客园 - Stanley.Luo

CentOS 7+nginx+PHP+php-fpm Linux 的系统目录介绍 C++与Java,C#的异同(一):值,地址,引用 Loom工具类:Unity3D巧妙处理多线程 3Dmax 创建物体 3DMax 物体选择方法 3DMax 常用快捷键 HTC Vive 与Leap Motion 出现位置错误的问题 Groovy与Gradle在Android中的应用 VR的UI、UX设计原则 为什么带网格(mesh)的模型添加了刚体Rigidbody和MeshCollider,还是会从地板穿过去? Mecanim动画模型规范 Mecanim动画系统 制作流程 HTC Vive 体验的折腾经历 OpenGLES 2.0 可编程渲染管线 【VR视频播放】解决Unity模型贴图反转的问题 Unity3D 的摄像机 iptables 的使用 CentOS安装Nginx
Lua语言的特别之处
Stanley.Luo · 2016-04-14 · via 博客园 - Stanley.Luo

所谓特别,是相对的,是相对别的主流语言而言,有些也可能只是我个人看法。

1. 函数定义与调用,与代码位置的先后顺序有关,例如

calculate()

function calculate()

 ....

end

运行起来会报错,说方法calculate未定义。如果先写function calculate(),再调用,就OK了。这与Java,C#等都不一样,Lua不是整体解析执行的,而是按顺序从前往后顺序解析的。

2. 数组(table)的index号是从1开始的,而不是0. 所以tableX[0]返回的回事nil。

3. 变量可以不需要预先声明,可以直接使用,这个特性带来很大的便利,特别的以table形式定义的结构体,随时可以添加一个新的属性定义,而不需要预先定义好。

更多特别之处,有待进一步总结。