├── logo.gif ├── README.md ├── osi-certified-72x60.png ├── manual.css ├── glossary.html ├── lua.css ├── lua.1 ├── luac.1 ├── index.html └── contents.html /logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudwu/lua53doc/HEAD/logo.gif -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Lua 5.3 手册中文版 2 | 3 | https://cloudwu.github.io/lua53doc 4 | -------------------------------------------------------------------------------- /osi-certified-72x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudwu/lua53doc/HEAD/osi-certified-72x60.png -------------------------------------------------------------------------------- /manual.css: -------------------------------------------------------------------------------- 1 | h3 code { 2 | font-family: inherit ; 3 | font-size: inherit ; 4 | } 5 | 6 | pre, code { 7 | font-size: 12pt ; 8 | font-family: Consolas,"Liberation Mono",Menlo,Courier,monospace; 9 | } 10 | 11 | span.apii { 12 | float: right ; 13 | font-family: inherit ; 14 | font-style: normal ; 15 | font-size: small ; 16 | color: gray ; 17 | } 18 | 19 | p+h1, ul+h1 { 20 | font-style: normal ; 21 | padding-top: 0.4em ; 22 | padding-bottom: 0.4em ; 23 | padding-left: 16px ; 24 | margin-left: -16px ; 25 | background-color: #D0D0FF ; 26 | border-radius: 8px ; 27 | border: solid #000080 1px ; 28 | } 29 | -------------------------------------------------------------------------------- /glossary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Lua 5.3 术语中英对照表 5 | 6 | 7 | 13 | 14 | 15 | 16 | 17 |
18 |

19 | 20 | Lua 5.3 术语中英对照表 21 |

22 | 23 |

24 | 译者在翻译时,使用了一些尚未统一的中文术语译词,统一罗列如下: 25 | 26 | 27 |
元表metatable 28 |
元方法metamethod 29 |
弱表weak table 30 |
协程coroutine 31 |
闭包closure 32 |
注册表registry 33 |
让出yield 34 |
table 35 |
用户数据userdata 36 |
延续点continuation 37 |
宿主host 38 |
一等公民first-class 39 |
语法糖syntactic sugar 40 |
序列sequence 41 |
异构heterogeneous 42 |
终结器finalizer 43 |
暂时表ephemeron table 44 |
符记token 45 |
字面串literal string 46 |
代码块chunk 47 |
标签label 48 |
实例化instantiated 49 |
上值upvalue 50 |
51 |


52 | 53 | 最后修改时间: 54 | 2015年1月14日23:07 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /lua.css: -------------------------------------------------------------------------------- 1 | html { 2 | background-color: #F8F8F8 ; 3 | } 4 | 5 | body { 6 | border: solid #a0a0a0 1px ; 7 | border-radius: 20px ; 8 | padding: 26px ; 9 | margin: 16px ; 10 | color: #000000 ; 11 | background-color: #FFFFFF ; 12 | font-family: "WenQuanYi Micro Hei", "Microsoft YaHei", Helvetica, Arial, sans-serif ; 13 | text-align: justify ; 14 | } 15 | 16 | h1, h2, h3, h4 { 17 | font-family: "WenQuanYi Micro Hei", "Microsoft YaHei", Helvetica, Verdana, Geneva, sans-serif ; 18 | font-weight: normal ; 19 | font-style: normal ; 20 | } 21 | 22 | h2 { 23 | padding-top: 0.4em ; 24 | padding-bottom: 0.4em ; 25 | padding-left: 0.8em ; 26 | padding-right: 0.8em ; 27 | background-color: #D0D0FF ; 28 | border-radius: 8px ; 29 | border: solid #a0a0a0 1px ; 30 | } 31 | 32 | h3 { 33 | padding-left: 0.5em ; 34 | border-left: solid #D0D0FF 1em ; 35 | } 36 | 37 | table h3 { 38 | padding-left: 0px ; 39 | border-left: none ; 40 | } 41 | 42 | a:link { 43 | color: #000080 ; 44 | background-color: inherit ; 45 | text-decoration: none ; 46 | } 47 | 48 | a:visited { 49 | background-color: inherit ; 50 | text-decoration: none ; 51 | } 52 | 53 | a:link:hover, a:visited:hover { 54 | color: #000080 ; 55 | background-color: #D0D0FF ; 56 | border-radius: 4px; 57 | } 58 | 59 | a:link:active, a:visited:active { 60 | color: #FF0000 ; 61 | } 62 | 63 | h1 a img { 64 | vertical-align: text-bottom ; 65 | } 66 | 67 | hr { 68 | border: 0 ; 69 | height: 1px ; 70 | color: #a0a0a0 ; 71 | background-color: #a0a0a0 ; 72 | display: none ; 73 | } 74 | 75 | table hr { 76 | display: block ; 77 | } 78 | 79 | :target { 80 | background-color: #F8F8F8 ; 81 | padding: 8px ; 82 | border: solid #a0a0a0 2px ; 83 | border-radius: 8px ; 84 | } 85 | 86 | .footer { 87 | color: gray ; 88 | font-size: x-small ; 89 | } 90 | 91 | input[type=text] { 92 | border: solid #a0a0a0 2px ; 93 | border-radius: 2em ; 94 | background-image: url('images/search.png') ; 95 | background-repeat: no-repeat ; 96 | background-position: 4px center ; 97 | padding-left: 20px ; 98 | height: 2em ; 99 | } 100 | 101 | pre.session { 102 | background-color: #F8F8F8 ; 103 | padding: 1em ; 104 | border-radius: 8px ; 105 | } 106 | -------------------------------------------------------------------------------- /lua.1: -------------------------------------------------------------------------------- 1 | .TH LUA 1 "$Date: 2014/12/10 15:55:45 $" 2 | .SH NAME 3 | lua \- Lua interpreter 4 | .SH SYNOPSIS 5 | .B lua 6 | [ 7 | .I options 8 | ] 9 | [ 10 | .I script 11 | [ 12 | .I args 13 | ] 14 | ] 15 | .SH DESCRIPTION 16 | .B lua 17 | is the standalone Lua interpreter. 18 | It loads and executes Lua programs, 19 | either in textual source form or 20 | in precompiled binary form. 21 | (Precompiled binaries are output by 22 | .BR luac , 23 | the Lua compiler.) 24 | .B lua 25 | can be used as a batch interpreter and also interactively. 26 | .LP 27 | The given 28 | .I options 29 | are handled in order and then 30 | the Lua program in file 31 | .I script 32 | is loaded and executed. 33 | The given 34 | .I args 35 | are available to 36 | .I script 37 | as strings in a global table named 38 | .BR arg . 39 | If no options or arguments are given, 40 | then 41 | .B "\-v \-i" 42 | is assumed when the standard input is a terminal; 43 | otherwise, 44 | .B "\-" 45 | is assumed. 46 | .LP 47 | In interactive mode, 48 | .B lua 49 | prompts the user, 50 | reads lines from the standard input, 51 | and executes them as they are read. 52 | If the line contains an expression or list of expressions, 53 | then the line is evaluated and the results are printed. 54 | If a line does not contain a complete statement, 55 | then a secondary prompt is displayed and 56 | lines are read until a complete statement is formed or 57 | a syntax error is found. 58 | .LP 59 | At the very start, 60 | before even handling the command line, 61 | .B lua 62 | checks the contents of the environment variables 63 | .B LUA_INIT_5_3 64 | or 65 | .BR LUA_INIT , 66 | in that order. 67 | If the contents is of the form 68 | .RI '@ filename ', 69 | then 70 | .I filename 71 | is executed. 72 | Otherwise, the string is assumed to be a Lua statement and is executed. 73 | .SH OPTIONS 74 | .TP 75 | .BI \-e " stat" 76 | execute statement 77 | .IR stat . 78 | .TP 79 | .B \-i 80 | enter interactive mode after executing 81 | .IR script . 82 | .TP 83 | .BI \-l " name" 84 | execute the equivalent of 85 | .IB name =require(' name ') 86 | before executing 87 | .IR script . 88 | .TP 89 | .B \-v 90 | show version information. 91 | .TP 92 | .B \-E 93 | ignore environment variables. 94 | .TP 95 | .B \-\- 96 | stop handling options. 97 | .TP 98 | .B \- 99 | stop handling options and execute the standard input as a file. 100 | .SH "SEE ALSO" 101 | .BR luac (1) 102 | .br 103 | The documentation at lua.org, 104 | especially section 7 of the reference manual. 105 | .SH DIAGNOSTICS 106 | Error messages should be self explanatory. 107 | .SH AUTHORS 108 | R. Ierusalimschy, 109 | L. H. de Figueiredo, 110 | W. Celes 111 | .\" EOF 112 | -------------------------------------------------------------------------------- /luac.1: -------------------------------------------------------------------------------- 1 | .\" $Id: luac.man,v 1.29 2011/11/16 13:53:40 lhf Exp $ 2 | .TH LUAC 1 "$Date: 2011/11/16 13:53:40 $" 3 | .SH NAME 4 | luac \- Lua compiler 5 | .SH SYNOPSIS 6 | .B luac 7 | [ 8 | .I options 9 | ] [ 10 | .I filenames 11 | ] 12 | .SH DESCRIPTION 13 | .B luac 14 | is the Lua compiler. 15 | It translates programs written in the Lua programming language 16 | into binary files containing precompiled chunks 17 | that can be later loaded and executed. 18 | .LP 19 | The main advantages of precompiling chunks are: 20 | faster loading, 21 | protecting source code from accidental user changes, 22 | and 23 | off-line syntax checking. 24 | Precompiling does not imply faster execution 25 | because in Lua chunks are always compiled into bytecodes before being executed. 26 | .B luac 27 | simply allows those bytecodes to be saved in a file for later execution. 28 | Precompiled chunks are not necessarily smaller than the corresponding source. 29 | The main goal in precompiling is faster loading. 30 | .LP 31 | In the command line, 32 | you can mix 33 | text files containing Lua source and 34 | binary files containing precompiled chunks. 35 | .B luac 36 | produces a single output file containing the combined bytecodes 37 | for all files given. 38 | Executing the combined file is equivalent to executing the given files. 39 | By default, 40 | the output file is named 41 | .BR luac.out , 42 | but you can change this with the 43 | .B \-o 44 | option. 45 | .LP 46 | Precompiled chunks are 47 | .I not 48 | portable across different architectures. 49 | Moreover, 50 | the internal format of precompiled chunks 51 | is likely to change when a new version of Lua is released. 52 | Make sure you save the source files of all Lua programs that you precompile. 53 | .LP 54 | .SH OPTIONS 55 | .TP 56 | .B \-l 57 | produce a listing of the compiled bytecode for Lua's virtual machine. 58 | Listing bytecodes is useful to learn about Lua's virtual machine. 59 | If no files are given, then 60 | .B luac 61 | loads 62 | .B luac.out 63 | and lists its contents. 64 | Use 65 | .B \-l \-l 66 | for a full listing. 67 | .TP 68 | .BI \-o " file" 69 | output to 70 | .IR file , 71 | instead of the default 72 | .BR luac.out . 73 | (You can use 74 | .B "'\-'" 75 | for standard output, 76 | but not on platforms that open standard output in text mode.) 77 | The output file may be one of the given files because 78 | all files are loaded before the output file is written. 79 | Be careful not to overwrite precious files. 80 | .TP 81 | .B \-p 82 | load files but do not generate any output file. 83 | Used mainly for syntax checking and for testing precompiled chunks: 84 | corrupted files will probably generate errors when loaded. 85 | If no files are given, then 86 | .B luac 87 | loads 88 | .B luac.out 89 | and tests its contents. 90 | No messages are displayed if the file loads without errors. 91 | .TP 92 | .B \-s 93 | strip debug information before writing the output file. 94 | This saves some space in very large chunks, 95 | but if errors occur when running a stripped chunk, 96 | then the error messages may not contain the full information they usually do. 97 | In particular, 98 | line numbers and names of local variables are lost. 99 | .TP 100 | .B \-v 101 | show version information. 102 | .TP 103 | .B \-\- 104 | stop handling options. 105 | .TP 106 | .B \- 107 | stop handling options and process standard input. 108 | .SH "SEE ALSO" 109 | .BR lua (1) 110 | .br 111 | The documentation at lua.org. 112 | .SH DIAGNOSTICS 113 | Error messages should be self explanatory. 114 | .SH AUTHORS 115 | R. Ierusalimschy, 116 | L. H. de Figueiredo, 117 | W. Celes 118 | .\" EOF 119 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Lua 5.3 readme 5 | 6 | 7 | 27 | 28 | 29 | 30 | 31 |
32 |

33 | Lua 34 | Lua 5.3 欢迎你 35 |

36 | 37 |

38 | 关于 39 | · 40 | 安装 41 | · 42 | 变更 43 | · 44 | 许可证 45 | · 46 | 参考手册 47 | · 48 | 中英术语对照表 49 | 50 |

关于 Lua

51 | 52 |

53 | Lua 是一门强大、快速、轻量的嵌入式脚本语言。它由巴西里约热内卢 Pontifical Catholic 大学的 54 | PUC-Rio 55 | 团队 56 | 开发。 57 | Lua 是一个 58 | 自由软件, 59 | 广泛应用于世界上无数产品和项目。 60 | 61 |

62 | Lua 的 63 | 官方网站 64 | 上提供了关于 Lua 的完整信息, 65 | 包括 66 | 综合概要 67 | 和最新的 68 | 文档, 69 | 需要注意的是 70 | 参考手册 可能和 71 | 这里的版本 有所不同。 72 | 73 |

安装 Lua

74 | 75 |

76 | Lua 以 77 | 源代码 78 | 的形式发布,使用之前,你需要构建它。 79 | 构建 Lua 非常简单,因为 Lua 是用纯粹的 ANSI C 实现的,在所有具备 ANSI C 编译器的平台都可以直接编译。 80 | 同时,Lua 也可以直接以 C++ 形式编译。 81 | 下面介绍了类 Unix 平台上的构建流程,另有 82 | 其它系统构建介绍 83 | 与 84 | 配置选项 以作参考。 85 | 86 |

87 | 如果你没有时间或兴趣自己编译 Lua, 88 | 可以从 89 | LuaBinaries 获取编译后的二进制文件 90 | 或者从 91 | LuaDist 这里获取 Lua 的多平台发布版(自带电池)。 92 | 93 |

构建 Lua

94 | 95 |

96 | 在大多数类 Unix 平台上,输入 "make" 加上合适的平台名即可。步骤如下: 97 | 98 |

    99 |
  1. 100 | 打开一个控制台窗口,切换到 lua-5.3.0 目录。 101 | 目录下的 Makefile 文件内包含了构建与安装流程。 102 |

    103 |

  2. 104 | 运行 "make" 并查看你的平台是否列在其中。 105 | 当前支持的平台有: 106 |

    107 |

    108 | aix bsd c89 freebsd generic linux macosx mingw posix solaris 109 |

    110 |

    111 | 如果你的平台在其中,运行 "make xxx" 即可,xxx 代表你的平台名。 112 |

    113 | 如果你的平台不在其中,先尝试最相近的平台,再按 posix generic c89 顺序依次尝试。 114 |

    115 |

  3. 116 | 编译过程很短,最终在 src 目录下生成三个文件: 117 | lua (解释器), 118 | luac (编译器)和 liblua.a (静态库) 。 119 |

    120 |

  4. 121 | 构建完成后,可以运行 "make test" 来检查是否成功。 122 | 它会运行解释器并打印版本号。 123 |
124 |

125 | 如果你是 Linux 系统并出现了编译错误,请确认你是否安装了 126 | readline (也可能叫 libreadline-dev 或者 readline-devel)开发包。 127 | 之后,如果还有链接错误,尝试 128 | "make linux MYLIBS=-ltermcap" 。 129 | 130 |

安装 Lua

131 |

132 | 一旦你构建完毕,可能希望把 Lua 安装到系统默认位置, 133 | 那么执行 "make install" 即可。 134 | 系统默认位置以及如何安装都定义在 Makefile 中。 135 | 这个过程可能需要有相关的权限。 136 | 137 |

138 | 运行 "make xxx install" 可以构建和安装一步到位,xxx 指你的平台名。 139 | 140 |

141 | 如果你想把 Lua 安装在本地,运行 "make local"。 142 | 它会创建一个 install 目录,内有 143 | bin, include, lib, man, share, 144 | 子目录,并将下列文件安装在其中。 145 | 146 | 如果你想安装到本地其它目录, 147 | 运行 "make install INSTALL_TOP=xxx",xxx 指你选择的目录。 148 | 由于安装过程中会切换到 src 以及 doc 目录进行, 149 | 所以当 INSTALL_TOP 不是绝对路径时务必小心。 150 | 151 |

152 |
153 | bin: 154 |
155 | lua luac 156 |
157 | include: 158 |
159 | lauxlib.h lua.h lua.hpp luaconf.h lualib.h 160 |
161 | lib: 162 |
163 | liblua.a 164 |
165 | man/man1: 166 |
167 | lua.1 luac.1 168 |
169 | 170 |

171 | 这些是开发时需要的目录。 172 | 如果你仅仅想运行一些 Lua 程序, 173 | 那么只需要 binman 下的文件。 174 | includelib 下的文件用于将 Lua 嵌入 175 | C 或 C++ 程序。 176 | 177 |

定制

178 |

179 | 有三类定制,可以通过编辑文件完成: 180 |

185 | 186 |

187 | 其实你不必编辑 Makefile 文件,make 的时候在命令行指定相关变量即可。 188 | 当然,编辑保存 Makefile 可以给定制留个记录。 189 | 190 |

191 | 另一方面,如果你需要定制一些 Lua 特性,那就需要在构建安装 Lua 前 192 | 编辑 src/luaconf.h 。 193 | 编辑过的文件必须确保一致性,也就是只安装在一个地方, 194 | 让所有你编译出来的用到 Lua 的程序都使用这唯一的这一份。 195 | 专家可以通过编辑 Lua 源代码来定制更多的东西。 196 | 197 |

在其它系统上构建 Lua

198 | 199 |

200 | 如果你不使用常规的 Unix 工具,那么构建 Lua 的流程就取决于你使用的编译器。 201 | 你需要创建若干工程来构建库,解释器以及编译器等。请把下列源文件加入相关工程: 202 | 203 |

204 |
205 | 库: 206 |
207 | lapi.c lcode.c lctype.c ldebug.c ldo.c ldump.c lfunc.c lgc.c llex.c 208 | lmem.c lobject.c lopcodes.c lparser.c lstate.c lstring.c ltable.c 209 | ltm.c lundump.c lvm.c lzio.c 210 | lauxlib.c lbaselib.c lbitlib.c lcorolib.c ldblib.c liolib.c 211 | lmathlib.c loslib.c lstrlib.c ltablib.c lutf8lib.c loadlib.c linit.c 212 |
213 | 解释器: 214 |
215 | library, lua.c 216 |
217 | 编译器: 218 |
219 | library, luac.c 220 |
221 | 222 |

223 | 把 Lua 以一个库形式用于你的程序,你需要知道如何用你的编译器创建库和使用库。 224 | 比如,以动态加载的 C 库形式使用 Lua,你需要了解如何创建动态库并让 Lua API 函数 225 | 在动态库中可见 — 不要 将 Lua 库链入每个动态库。 226 | 在 Unix 下,我们建议把 Lua 库静态链入宿主程序,然后将符号导出用于动态链接; 227 | src/Makefile 就是这样处理 Lua 解释器的。 228 | 在 Windows 下,我们建议把 Lua 库编译成一个 DLL 。 229 | 无论怎样,编译器 luac 都应该静态链接。 230 | 231 |

232 | 正如上面所述,你可以在构建 Lua 前编辑 src/luaconf.h 233 | 以定制一些特性。 234 | 235 |

自 Lua 5.2 以来的变更

236 | 237 |

238 | 这里列出了 Lua 5.3 引入的主要变更。 239 | 参考手册 240 | 中列出了 241 | 不兼容的地方。 242 | 243 |

主要变化

244 | 252 | 253 | 这些是 Lua 5.3 引入的其它变更: 254 |

语言

255 | 260 | 261 |

262 | 271 | 272 |

C API

273 | 284 | 285 |

Lua 独立解释器

286 | 290 | 291 |

License

292 | 293 | [osi certified] 294 | 295 | 296 |

297 | Lua is free software distributed under the terms of the 298 | MIT license 299 | reproduced below; 300 | it may be used for any purpose, including commercial purposes, 301 | at absolutely no cost without having to ask us. 302 | 303 | The only requirement is that if you do use Lua, 304 | then you should give us credit by including the appropriate copyright notice somewhere in your product or its documentation. 305 | 306 | For details, see 307 | this. 308 | 309 |

310 | Copyright © 1994–2015 Lua.org, PUC-Rio. 311 | 312 |

313 | Permission is hereby granted, free of charge, to any person obtaining a copy 314 | of this software and associated documentation files (the "Software"), to deal 315 | in the Software without restriction, including without limitation the rights 316 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 317 | copies of the Software, and to permit persons to whom the Software is 318 | furnished to do so, subject to the following conditions: 319 | 320 |

321 | The above copyright notice and this permission notice shall be included in 322 | all copies or substantial portions of the Software. 323 | 324 |

325 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 326 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 327 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 328 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 329 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 330 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 331 | THE SOFTWARE. 332 |

333 |

334 | 335 |


336 | 337 | 最后修改时间: 338 | 2015年1月13日15:16 339 | 340 | 341 | 342 | 343 | -------------------------------------------------------------------------------- /contents.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Lua 5.3 参考手册 - 目录 5 | 6 | 7 | 13 | 14 | 15 | 16 | 17 |
18 |

19 | 20 | Lua 5.3 参考手册 21 |

22 | 23 |

24 | 这份参考手册是对 Lua 语言的官方定义。 25 | 关于 Lua 编程的全部细节,则放在 26 | Programming in Lua 27 | 这本书中。 28 | 29 |

30 | 开始 31 | · 32 | 目录 33 | · 34 | 索引 35 | · 36 | 中英术语对照表 37 |


38 | 39 | Lua.org, PUC-Rio 版权所有 © 2015 , 40 | 在遵循 41 | Lua license 42 | 条款下,可自由使用。 43 | 44 | 45 |

目录

46 | 141 | 142 |

索引

143 | 144 | 145 | 231 | 336 | 472 | 610 | 611 |
146 |

Lua 函数

147 |

148 | 基础
149 | _G
150 | _VERSION
151 | 152 | assert
153 | collectgarbage
154 | dofile
155 | error
156 | getmetatable
157 | ipairs
158 | load
159 | loadfile
160 | next
161 | pairs
162 | pcall
163 | print
164 | rawequal
165 | rawget
166 | rawlen
167 | rawset
168 | require
169 | select
170 | setmetatable
171 | tonumber
172 | tostring
173 | type
174 | xpcall
175 | 176 |

177 | 协程
178 | coroutine.create
179 | coroutine.isyieldable
180 | coroutine.resume
181 | coroutine.running
182 | coroutine.status
183 | coroutine.wrap
184 | coroutine.yield
185 | 186 |

187 | 调试
188 | debug.debug
189 | debug.gethook
190 | debug.getinfo
191 | debug.getlocal
192 | debug.getmetatable
193 | debug.getregistry
194 | debug.getupvalue
195 | debug.getuservalue
196 | debug.sethook
197 | debug.setlocal
198 | debug.setmetatable
199 | debug.setupvalue
200 | debug.setuservalue
201 | debug.traceback
202 | debug.upvalueid
203 | debug.upvaluejoin
204 | 205 |

206 | 输入输出
207 | io.close
208 | io.flush
209 | io.input
210 | io.lines
211 | io.open
212 | io.output
213 | io.popen
214 | io.read
215 | io.stderr
216 | io.stdin
217 | io.stdout
218 | io.tmpfile
219 | io.type
220 | io.write
221 | 222 | file:close
223 | file:flush
224 | file:lines
225 | file:read
226 | file:seek
227 | file:setvbuf
228 | file:write
229 | 230 |

232 |

 

233 |

234 | 数学
235 | math.abs
236 | math.acos
237 | math.asin
238 | math.atan
239 | math.ceil
240 | math.cos
241 | math.deg
242 | math.exp
243 | math.floor
244 | math.fmod
245 | math.huge
246 | math.log
247 | math.max
248 | math.maxinteger
249 | math.min
250 | math.mininteger
251 | math.modf
252 | math.pi
253 | math.rad
254 | math.random
255 | math.randomseed
256 | math.sin
257 | math.sqrt
258 | math.tan
259 | math.tointeger
260 | math.type
261 | math.ult
262 | 263 |

264 | 操作系统
265 | os.clock
266 | os.date
267 | os.difftime
268 | os.execute
269 | os.exit
270 | os.getenv
271 | os.remove
272 | os.rename
273 | os.setlocale
274 | os.time
275 | os.tmpname
276 | 277 |

278 |
279 | package.config
280 | package.cpath
281 | package.loaded
282 | package.loadlib
283 | package.path
284 | package.preload
285 | package.searchers
286 | package.searchpath
287 | 288 |

289 | 字符串
290 | string.byte
291 | string.char
292 | string.dump
293 | string.find
294 | string.format
295 | string.gmatch
296 | string.gsub
297 | string.len
298 | string.lower
299 | string.match
300 | string.pack
301 | string.packsize
302 | string.rep
303 | string.reverse
304 | string.sub
305 | string.unpack
306 | string.upper
307 | 308 |

309 |
310 | table.concat
311 | table.insert
312 | table.move
313 | table.pack
314 | table.remove
315 | table.sort
316 | table.unpack
317 | 318 |

319 | utf8
320 | utf8.char
321 | utf8.charpattern
322 | utf8.codepoint
323 | utf8.codes
324 | utf8.len
325 | utf8.offset
326 | 327 |

环境变量

328 | LUA_CPATH
329 | LUA_CPATH_5_3
330 | LUA_INIT
331 | LUA_INIT_5_3
332 | LUA_PATH
333 | LUA_PATH_5_3
334 | 335 |
337 |

C API

338 |

339 | lua_Alloc
340 | lua_CFunction
341 | lua_Debug
342 | lua_Hook
343 | lua_Integer
344 | lua_KContext
345 | lua_KFunction
346 | lua_Number
347 | lua_Reader
348 | lua_State
349 | lua_Unsigned
350 | lua_Writer
351 | 352 |

353 | lua_absindex
354 | lua_arith
355 | lua_atpanic
356 | lua_call
357 | lua_callk
358 | lua_checkstack
359 | lua_close
360 | lua_compare
361 | lua_concat
362 | lua_copy
363 | lua_createtable
364 | lua_dump
365 | lua_error
366 | lua_gc
367 | lua_getallocf
368 | lua_getextraspace
369 | lua_getfield
370 | lua_getglobal
371 | lua_gethook
372 | lua_gethookcount
373 | lua_gethookmask
374 | lua_geti
375 | lua_getinfo
376 | lua_getlocal
377 | lua_getmetatable
378 | lua_getstack
379 | lua_gettable
380 | lua_gettop
381 | lua_getupvalue
382 | lua_getuservalue
383 | lua_insert
384 | lua_isboolean
385 | lua_iscfunction
386 | lua_isfunction
387 | lua_isinteger
388 | lua_islightuserdata
389 | lua_isnil
390 | lua_isnone
391 | lua_isnoneornil
392 | lua_isnumber
393 | lua_isstring
394 | lua_istable
395 | lua_isthread
396 | lua_isuserdata
397 | lua_isyieldable
398 | lua_len
399 | lua_load
400 | lua_newstate
401 | lua_newtable
402 | lua_newthread
403 | lua_newuserdata
404 | lua_next
405 | lua_numbertointeger
406 | lua_pcall
407 | lua_pcallk
408 | lua_pop
409 | lua_pushboolean
410 | lua_pushcclosure
411 | lua_pushcfunction
412 | lua_pushfstring
413 | lua_pushglobaltable
414 | lua_pushinteger
415 | lua_pushlightuserdata
416 | lua_pushliteral
417 | lua_pushlstring
418 | lua_pushnil
419 | lua_pushnumber
420 | lua_pushstring
421 | lua_pushthread
422 | lua_pushvalue
423 | lua_pushvfstring
424 | lua_rawequal
425 | lua_rawget
426 | lua_rawgeti
427 | lua_rawgetp
428 | lua_rawlen
429 | lua_rawset
430 | lua_rawseti
431 | lua_rawsetp
432 | lua_register
433 | lua_remove
434 | lua_replace
435 | lua_resume
436 | lua_rotate
437 | lua_setallocf
438 | lua_setfield
439 | lua_setglobal
440 | lua_sethook
441 | lua_seti
442 | lua_setlocal
443 | lua_setmetatable
444 | lua_settable
445 | lua_settop
446 | lua_setupvalue
447 | lua_setuservalue
448 | lua_status
449 | lua_stringtonumber
450 | lua_toboolean
451 | lua_tocfunction
452 | lua_tointeger
453 | lua_tointegerx
454 | lua_tolstring
455 | lua_tonumber
456 | lua_tonumberx
457 | lua_topointer
458 | lua_tostring
459 | lua_tothread
460 | lua_touserdata
461 | lua_type
462 | lua_typename
463 | lua_upvalueid
464 | lua_upvalueindex
465 | lua_upvaluejoin
466 | lua_version
467 | lua_xmove
468 | lua_yield
469 | lua_yieldk
470 | 471 |

473 |

辅助库

474 |

475 | luaL_Buffer
476 | luaL_Reg
477 | luaL_Stream
478 | 479 |

480 | luaL_addchar
481 | luaL_addlstring
482 | luaL_addsize
483 | luaL_addstring
484 | luaL_addvalue
485 | luaL_argcheck
486 | luaL_argerror
487 | luaL_buffinit
488 | luaL_buffinitsize
489 | luaL_callmeta
490 | luaL_checkany
491 | luaL_checkinteger
492 | luaL_checklstring
493 | luaL_checknumber
494 | luaL_checkoption
495 | luaL_checkstack
496 | luaL_checkstring
497 | luaL_checktype
498 | luaL_checkudata
499 | luaL_checkversion
500 | luaL_dofile
501 | luaL_dostring
502 | luaL_error
503 | luaL_execresult
504 | luaL_fileresult
505 | luaL_getmetafield
506 | luaL_getmetatable
507 | luaL_getsubtable
508 | luaL_gsub
509 | luaL_len
510 | luaL_loadbuffer
511 | luaL_loadbufferx
512 | luaL_loadfile
513 | luaL_loadfilex
514 | luaL_loadstring
515 | luaL_newlib
516 | luaL_newlibtable
517 | luaL_newmetatable
518 | luaL_newstate
519 | luaL_openlibs
520 | luaL_optinteger
521 | luaL_optlstring
522 | luaL_optnumber
523 | luaL_optstring
524 | luaL_prepbuffer
525 | luaL_prepbuffsize
526 | luaL_pushresult
527 | luaL_pushresultsize
528 | luaL_ref
529 | luaL_requiref
530 | luaL_setfuncs
531 | luaL_setmetatable
532 | luaL_testudata
533 | luaL_tolstring
534 | luaL_traceback
535 | luaL_typename
536 | luaL_unref
537 | luaL_where
538 | 539 |

标准库

540 |

541 | luaopen_base
542 | luaopen_coroutine
543 | luaopen_debug
544 | luaopen_io
545 | luaopen_math
546 | luaopen_os
547 | luaopen_package
548 | luaopen_string
549 | luaopen_table
550 | luaopen_utf8
551 | 552 |

常量

553 | LUA_ERRERR
554 | LUA_ERRFILE
555 | LUA_ERRGCMM
556 | LUA_ERRMEM
557 | LUA_ERRRUN
558 | LUA_ERRSYNTAX
559 | LUA_HOOKCALL
560 | LUA_HOOKCOUNT
561 | LUA_HOOKLINE
562 | LUA_HOOKRET
563 | LUA_HOOKTAILCALL
564 | LUA_MASKCALL
565 | LUA_MASKCOUNT
566 | LUA_MASKLINE
567 | LUA_MASKRET
568 | LUA_MAXINTEGER
569 | LUA_MININTEGER
570 | LUA_MINSTACK
571 | LUA_MULTRET
572 | LUA_NOREF
573 | LUA_OK
574 | LUA_OPADD
575 | LUA_OPBAND
576 | LUA_OPBNOT
577 | LUA_OPBOR
578 | LUA_OPBXOR
579 | LUA_OPDIV
580 | LUA_OPEQ
581 | LUA_OPIDIV
582 | LUA_OPLE
583 | LUA_OPLT
584 | LUA_OPMOD
585 | LUA_OPMUL
586 | LUA_OPPOW
587 | LUA_OPSHL
588 | LUA_OPSHR
589 | LUA_OPSUB
590 | LUA_OPUNM
591 | LUA_REFNIL
592 | LUA_REGISTRYINDEX
593 | LUA_RIDX_GLOBALS
594 | LUA_RIDX_MAINTHREAD
595 | LUA_TBOOLEAN
596 | LUA_TFUNCTION
597 | LUA_TLIGHTUSERDATA
598 | LUA_TNIL
599 | LUA_TNONE
600 | LUA_TNUMBER
601 | LUA_TSTRING
602 | LUA_TTABLE
603 | LUA_TTHREAD
604 | LUA_TUSERDATA
605 | LUA_USE_APICHECK
606 | LUA_YIELD
607 | LUAL_BUFFERSIZE
608 | 609 |
612 | 613 |
614 | 615 | 最后更新时间: 616 | 2015年1月18日19:49 617 | 618 | 619 | 620 | 621 | --------------------------------------------------------------------------------