
Note:Programming in Lua
DonZpp
这个作者很懒,什么都没留下…
展开
-
Note:Programming in Lua - Chapter 1 Getting Started
Chapter 1 GettingStartedhello.lua 假定已配置好lua解释器及环境变量。 对于hello程序,只需要新建一个文件并输入一行代码: print("helloworld!") 之后将文件保存,如hello.lua。再运行lua解释器即可: luahello.lualua解释器 lua有一种交互模式...原创 2018-06-29 17:44:23 · 177 阅读 · 0 评论 -
Note:Programming in Lua - Chapter 2 :Type and Value
Base lua,动态类型语言。lua有8种基础类型:nil/boolean/number(实数)/string/userdata(自定义类型)/function/thread(线程)/table(表)。 可用type函数得到一个值的类型,type的返回值是一个string。 lua中变量没有预定义的类型,任何变量可包含任何类型的值。注意函数也是一种值: ...原创 2018-07-14 12:05:27 · 204 阅读 · 0 评论 -
Study Lua : 像使用执行文件一样使用Lua文件
在《Programming in Lua》一书中有对这种操作的描述: 但如果我们直接按这种方法做,可能不会成功。因为我们Lua程序的位置和书上的可能不太一样。 如何得到我们系统中Lua可执行文件的位置呢? 我们可以使用which命令,如下: 然后我们可以这样编写我们的文件:#!/usr/bin/luaprint("hello world! hello script!") ...原创 2018-07-14 15:01:50 · 839 阅读 · 0 评论