《Lua程序设计》学习笔记
命令行执行类型为table的全局变量arg保存命令行参数,脚本名为arg[0],真正的参数从arg[1]开始,而脚本之前则是负数的下标
例如lua -e "sin=math.sin" script a b的参数如下
arg[-3] = "lua"arg[-2] = "-e"arg[-1] = "sin=math.sin"arg[0] = "script"arg[1] = "a"arg[2] = "b"
八种基本数据类型
nil
Boolean
number
string
userdata
function
thread
table
Lua是一个动态类型语言,不用声明变量的类型,每个变量携带自己的类型
type(v) 获取v的变量类型,返回的是字符串
type(a) --> nila = 1 type(a) --> numbera = "1" type(a) --> ...
Test
This is my first blog for testing the function of hexo.
Hello World
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.
Quick StartCreate a new post$ hexo new "My New Post"
More info: Writing
Run server$ hexo server
More info: Server
Generate static files$ hexo generate
More info: Generating
Deploy to remote sites$ hexo deploy
More info: Deployment