当前位置:网站首页>lua基础
lua基础
2022-07-21 21:41:00 【怪力左手】
lua
lua源代码:https://github.com/LuaDist/lua.git
腾讯开发的基于c#的xlua,tolua和xlua类似
grammer
Lua 中有 8 个基本类型分别为:nil、boolean、number、string、userdata(c语言数据结构)、function(支持c和lua编写的函数)、coroutine(协程) 和 table(数据或者map,{},索引从默认1开始,可以指定从0开始)
lua中的变量全是全局变量,除非local声明为局部变量
- 特殊函数
- select(‘#’, …),返回可变参数的长度
- select(n, …) ,用于返回从起点 n 开始到结束位置的所有参数列表
- type,获取数据类型
- pair,遍历键值对,ipair固定索引1遍历,索引不连续会中断
- setmetatable(table,metatable)表关联元表,getmetatabl
边栏推荐
- 有return的情况下try catch finally的执行顺序
- 一个15年ABAP老兵的建议:了解这些基础知识,对ABAP开发有百利而无一害
- 网站上线功能及兼容性测试小工具集…
- HCIP第十二天
- 实操演练 | 使用 Navicat 对 MySQL 表进行分区
- Day04 禅道-从安装到卸载
- [mathematics of machine learning 01] countable sets and uncountable sets
- 墙纸教程–精美水下效果
- Real time joint simulation of smart grid hardware based on FPGA Jetson
- 一文读懂Elephant Swap的LaaS方案的优势之处
猜你喜欢
QT: keyboard events, mouse events, timer small instances
Part 01: distributed registry
Legend setup tutorial GOM engine micro terminal setting method
Day010 cycle structure
Flutter实战-自定义键盘(三)
SCA在得物DevSecOps平台上应用
Video 46 13.9 Semantic segmentation and data set 13.10 transpose convolution
JVM parameter configuration description
分布式系统认证方案探究
Flutter实战-自定义键盘(二)
随机推荐
白嫖1000道面试题,看完哑巴都能面过
Application of SCA on devsecops platform
墙纸教程–精美水下效果
Chang'an's new strongest SUV is coming. The interior is very three-dimensional, and the sense of science and technology is bursting
关于目前流行的 Redis 可视化管理工具的详细评测
缺陷报告作业
Ansible project best practices
Pikachu character injection for Day2 POC and exp learning
网站上线功能及兼容性测试小工具集…
Part 02: distributed load balancing
Why is it said that the software testing post is a huge pit? The 10-year-old tester told you not to be fooled
LeetCode:814. Binary tree pruning [recursion]
Uniapp encapsulation request
【 可选:在移动设备上运行您的应用】
[oops framework] local storage
[stl]vector Simulation Implementation
引入 CloudWeGo 后飞书管理后台平台化改造的演进史
Web3 can't escape from the Wuzhishan of these old giants no matter how powerful it is
[MySQL] 20-how MySQL creates and manages super detailed summaries of tables
Can you solve the pain points of interface testing now