comparison docs/manual.html @ 240:bcc3911285a2

add manual css files git-svn-id: https://luan-java.googlecode.com/svn/trunk@241 21e917c8-12df-6dd8-5cb6-c86387c605b9
author fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
date Mon, 06 Oct 2014 22:27:24 +0000
parents aa7bc9c1df22
children 852840d64a7f
comparison
equal deleted inserted replaced
239:aa7bc9c1df22 240:bcc3911285a2
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html> 2 <html>
3 3
4 <head> 4 <head>
5 <title>Lua 5.2 Reference Manual</title> 5 <title>Lua 5.2 Reference Manual</title>
6 <link rel="stylesheet" type="text/css" href="http://www.lua.org/lua.css"> 6 <link rel="stylesheet" type="text/css" href="lua.css">
7 <link rel="stylesheet" type="text/css" href="http://www.lua.org/manual/manual.css"> 7 <link rel="stylesheet" type="text/css" href="manual.css">
8 <META HTTP-EQUIV="content-type" CONTENT="text/html; charset=iso-8859-1"> 8 <META HTTP-EQUIV="content-type" CONTENT="text/html; charset=iso-8859-1">
9 </head> 9 </head>
10 10
11 <body> 11 <body>
12 12
13 <hr> 13 <hr>
14 <h1> 14 <h1>
15 <a href="../../home.html"><img src="../../images/logo.gif" alt="" border="0"></a> 15 Luan Reference Manual
16 Lua 5.2 Reference Manual
17 </h1> 16 </h1>
18 17
19 by Roberto Ierusalimschy, Luiz Henrique de Figueiredo, Waldemar Celes 18 <P>
19 The reference manual is the official definition of the Luan language.
20
20 <p> 21 <p>
21 <small> 22 <small>
22 Copyright &copy; 2011&ndash;2013 Lua.org, PUC-Rio. 23 Original Copyright &copy; 2011&ndash;2013 Lua.org, PUC-Rio.
23 Freely available under the terms of the 24 Freely available under the terms of the
24 <a href="../../license.html">Lua license</a>. 25 <a href="http://www.lua.org/license.html">Lua license</a>.
26 Modified for Luan in 2014.
25 </small> 27 </small>
26 <hr> 28 <hr>
27 <p> 29 <p>
28 30
29 <a href="contents.html#contents">contents</A>
30 &middot;
31 <a href="contents.html#index">index</A>
32 &middot;
33 <a href="../">other versions</A>
34 31
35 <!-- ====================================================================== --> 32 <!-- ====================================================================== -->
36 <p> 33 <p>
37 34
38 <!-- $Id: manual.of,v 1.103 2013/03/14 18:51:56 roberto Exp $ --> 35 <!-- $Id: manual.of,v 1.103 2013/03/14 18:51:56 roberto Exp $ -->
39 36
40 37
41 <H2><A NAME="contents">Contents</A></H2> 38 <H2><A NAME="contents">Contents</A></H2>
42 <UL style="padding: 0"> 39 <UL style="padding: 0">
43 <LI><A HREF="manual.html#1">1 &ndash; Introduction</A> 40 <LI><A HREF="#1">1 &ndash; Introduction</A>
44 <P> 41 <P>
45 <LI><A HREF="manual.html#2">2 &ndash; Basic Concepts</A> 42 <LI><A HREF="#2">2 &ndash; Basic Concepts</A>
46 <UL> 43 <UL>
47 <LI><A HREF="manual.html#2.1">2.1 &ndash; Values and Types</A> 44 <LI><A HREF="#2.1">2.1 &ndash; Values and Types</A>
48 <LI><A HREF="manual.html#2.2">2.2 &ndash; Environments and the Global Environment</A> 45 <LI><A HREF="#2.2">2.2 &ndash; Environments and the Global Environment</A>
49 <LI><A HREF="manual.html#2.3">2.3 &ndash; Error Handling</A> 46 <LI><A HREF="#2.3">2.3 &ndash; Error Handling</A>
50 <LI><A HREF="manual.html#2.4">2.4 &ndash; Metatables and Metamethods</A> 47 <LI><A HREF="#2.4">2.4 &ndash; Metatables and Metamethods</A>
51 <LI><A HREF="manual.html#2.5">2.5 &ndash; Garbage Collection</A> 48 <LI><A HREF="#2.5">2.5 &ndash; Garbage Collection</A>
52 <UL> 49 <UL>
53 <LI><A HREF="manual.html#2.5.1">2.5.1 &ndash; Garbage-Collection Metamethods</A> 50 <LI><A HREF="#2.5.1">2.5.1 &ndash; Garbage-Collection Metamethods</A>
54 <LI><A HREF="manual.html#2.5.2">2.5.2 &ndash; Weak Tables</A> 51 <LI><A HREF="#2.5.2">2.5.2 &ndash; Weak Tables</A>
55 </UL> 52 </UL>
56 <LI><A HREF="manual.html#2.6">2.6 &ndash; Coroutines</A> 53 <LI><A HREF="#2.6">2.6 &ndash; Coroutines</A>
57 </UL> 54 </UL>
58 <P> 55 <P>
59 <LI><A HREF="manual.html#3">3 &ndash; The Language</A> 56 <LI><A HREF="#3">3 &ndash; The Language</A>
60 <UL> 57 <UL>
61 <LI><A HREF="manual.html#3.1">3.1 &ndash; Lexical Conventions</A> 58 <LI><A HREF="#3.1">3.1 &ndash; Lexical Conventions</A>
62 <LI><A HREF="manual.html#3.2">3.2 &ndash; Variables</A> 59 <LI><A HREF="#3.2">3.2 &ndash; Variables</A>
63 <LI><A HREF="manual.html#3.3">3.3 &ndash; Statements</A> 60 <LI><A HREF="#3.3">3.3 &ndash; Statements</A>
64 <UL> 61 <UL>
65 <LI><A HREF="manual.html#3.3.1">3.3.1 &ndash; Blocks</A> 62 <LI><A HREF="#3.3.1">3.3.1 &ndash; Blocks</A>
66 <LI><A HREF="manual.html#3.3.2">3.3.2 &ndash; Chunks</A> 63 <LI><A HREF="#3.3.2">3.3.2 &ndash; Chunks</A>
67 <LI><A HREF="manual.html#3.3.3">3.3.3 &ndash; Assignment</A> 64 <LI><A HREF="#3.3.3">3.3.3 &ndash; Assignment</A>
68 <LI><A HREF="manual.html#3.3.4">3.3.4 &ndash; Control Structures</A> 65 <LI><A HREF="#3.3.4">3.3.4 &ndash; Control Structures</A>
69 <LI><A HREF="manual.html#3.3.5">3.3.5 &ndash; For Statement</A> 66 <LI><A HREF="#3.3.5">3.3.5 &ndash; For Statement</A>
70 <LI><A HREF="manual.html#3.3.6">3.3.6 &ndash; Function Calls as Statements</A> 67 <LI><A HREF="#3.3.6">3.3.6 &ndash; Function Calls as Statements</A>
71 <LI><A HREF="manual.html#3.3.7">3.3.7 &ndash; Local Declarations</A> 68 <LI><A HREF="#3.3.7">3.3.7 &ndash; Local Declarations</A>
72 </UL> 69 </UL>
73 <LI><A HREF="manual.html#3.4">3.4 &ndash; Expressions</A> 70 <LI><A HREF="#3.4">3.4 &ndash; Expressions</A>
74 <UL> 71 <UL>
75 <LI><A HREF="manual.html#3.4.1">3.4.1 &ndash; Arithmetic Operators</A> 72 <LI><A HREF="#3.4.1">3.4.1 &ndash; Arithmetic Operators</A>
76 <LI><A HREF="manual.html#3.4.2">3.4.2 &ndash; Coercion</A> 73 <LI><A HREF="#3.4.2">3.4.2 &ndash; Coercion</A>
77 <LI><A HREF="manual.html#3.4.3">3.4.3 &ndash; Relational Operators</A> 74 <LI><A HREF="#3.4.3">3.4.3 &ndash; Relational Operators</A>
78 <LI><A HREF="manual.html#3.4.4">3.4.4 &ndash; Logical Operators</A> 75 <LI><A HREF="#3.4.4">3.4.4 &ndash; Logical Operators</A>
79 <LI><A HREF="manual.html#3.4.5">3.4.5 &ndash; Concatenation</A> 76 <LI><A HREF="#3.4.5">3.4.5 &ndash; Concatenation</A>
80 <LI><A HREF="manual.html#3.4.6">3.4.6 &ndash; The Length Operator</A> 77 <LI><A HREF="#3.4.6">3.4.6 &ndash; The Length Operator</A>
81 <LI><A HREF="manual.html#3.4.7">3.4.7 &ndash; Precedence</A> 78 <LI><A HREF="#3.4.7">3.4.7 &ndash; Precedence</A>
82 <LI><A HREF="manual.html#3.4.8">3.4.8 &ndash; Table Constructors</A> 79 <LI><A HREF="#3.4.8">3.4.8 &ndash; Table Constructors</A>
83 <LI><A HREF="manual.html#3.4.9">3.4.9 &ndash; Function Calls</A> 80 <LI><A HREF="#3.4.9">3.4.9 &ndash; Function Calls</A>
84 <LI><A HREF="manual.html#3.4.10">3.4.10 &ndash; Function Definitions</A> 81 <LI><A HREF="#3.4.10">3.4.10 &ndash; Function Definitions</A>
85 </UL> 82 </UL>
86 <LI><A HREF="manual.html#3.5">3.5 &ndash; Visibility Rules</A> 83 <LI><A HREF="#3.5">3.5 &ndash; Visibility Rules</A>
87 </UL> 84 </UL>
88 <P> 85 <P>
89 <LI><A HREF="manual.html#4">4 &ndash; The Application Program Interface</A> 86 <LI><A HREF="#4">4 &ndash; The Application Program Interface</A>
90 <UL> 87 <UL>
91 <LI><A HREF="manual.html#4.1">4.1 &ndash; The Stack</A> 88 <LI><A HREF="#4.1">4.1 &ndash; The Stack</A>
92 <LI><A HREF="manual.html#4.2">4.2 &ndash; Stack Size</A> 89 <LI><A HREF="#4.2">4.2 &ndash; Stack Size</A>
93 <LI><A HREF="manual.html#4.3">4.3 &ndash; Valid and Acceptable Indices</A> 90 <LI><A HREF="#4.3">4.3 &ndash; Valid and Acceptable Indices</A>
94 <LI><A HREF="manual.html#4.4">4.4 &ndash; C Closures</A> 91 <LI><A HREF="#4.4">4.4 &ndash; C Closures</A>
95 <LI><A HREF="manual.html#4.5">4.5 &ndash; Registry</A> 92 <LI><A HREF="#4.5">4.5 &ndash; Registry</A>
96 <LI><A HREF="manual.html#4.6">4.6 &ndash; Error Handling in C</A> 93 <LI><A HREF="#4.6">4.6 &ndash; Error Handling in C</A>
97 <LI><A HREF="manual.html#4.7">4.7 &ndash; Handling Yields in C</A> 94 <LI><A HREF="#4.7">4.7 &ndash; Handling Yields in C</A>
98 <LI><A HREF="manual.html#4.8">4.8 &ndash; Functions and Types</A> 95 <LI><A HREF="#4.8">4.8 &ndash; Functions and Types</A>
99 <LI><A HREF="manual.html#4.9">4.9 &ndash; The Debug Interface</A> 96 <LI><A HREF="#4.9">4.9 &ndash; The Debug Interface</A>
100 </UL> 97 </UL>
101 <P> 98 <P>
102 <LI><A HREF="manual.html#5">5 &ndash; The Auxiliary Library</A> 99 <LI><A HREF="#5">5 &ndash; The Auxiliary Library</A>
103 <UL> 100 <UL>
104 <LI><A HREF="manual.html#5.1">5.1 &ndash; Functions and Types</A> 101 <LI><A HREF="#5.1">5.1 &ndash; Functions and Types</A>
105 </UL> 102 </UL>
106 <P> 103 <P>
107 <LI><A HREF="manual.html#6">6 &ndash; Standard Libraries</A> 104 <LI><A HREF="#6">6 &ndash; Standard Libraries</A>
108 <UL> 105 <UL>
109 <LI><A HREF="manual.html#6.1">6.1 &ndash; Basic Functions</A> 106 <LI><A HREF="#6.1">6.1 &ndash; Basic Functions</A>
110 <LI><A HREF="manual.html#6.2">6.2 &ndash; Coroutine Manipulation</A> 107 <LI><A HREF="#6.2">6.2 &ndash; Coroutine Manipulation</A>
111 <LI><A HREF="manual.html#6.3">6.3 &ndash; Modules</A> 108 <LI><A HREF="#6.3">6.3 &ndash; Modules</A>
112 <LI><A HREF="manual.html#6.4">6.4 &ndash; String Manipulation</A> 109 <LI><A HREF="#6.4">6.4 &ndash; String Manipulation</A>
113 <UL> 110 <UL>
114 <LI><A HREF="manual.html#6.4.1">6.4.1 &ndash; Patterns</A> 111 <LI><A HREF="#6.4.1">6.4.1 &ndash; Patterns</A>
115 </UL> 112 </UL>
116 <LI><A HREF="manual.html#6.5">6.5 &ndash; Table Manipulation</A> 113 <LI><A HREF="#6.5">6.5 &ndash; Table Manipulation</A>
117 <LI><A HREF="manual.html#6.6">6.6 &ndash; Mathematical Functions</A> 114 <LI><A HREF="#6.6">6.6 &ndash; Mathematical Functions</A>
118 <LI><A HREF="manual.html#6.7">6.7 &ndash; Bitwise Operations</A> 115 <LI><A HREF="#6.7">6.7 &ndash; Bitwise Operations</A>
119 <LI><A HREF="manual.html#6.8">6.8 &ndash; Input and Output Facilities</A> 116 <LI><A HREF="#6.8">6.8 &ndash; Input and Output Facilities</A>
120 <LI><A HREF="manual.html#6.9">6.9 &ndash; Operating System Facilities</A> 117 <LI><A HREF="#6.9">6.9 &ndash; Operating System Facilities</A>
121 <LI><A HREF="manual.html#6.10">6.10 &ndash; The Debug Library</A> 118 <LI><A HREF="#6.10">6.10 &ndash; The Debug Library</A>
122 </UL> 119 </UL>
123 <P> 120 <P>
124 <LI><A HREF="manual.html#7">7 &ndash; Lua Standalone</A> 121 <LI><A HREF="#7">7 &ndash; Lua Standalone</A>
125 <P> 122 <P>
126 <LI><A HREF="manual.html#8">8 &ndash; Incompatibilities with the Previous Version</A> 123 <LI><A HREF="#8">8 &ndash; Incompatibilities with the Previous Version</A>
127 <UL> 124 <UL>
128 <LI><A HREF="manual.html#8.1">8.1 &ndash; Changes in the Language</A> 125 <LI><A HREF="#8.1">8.1 &ndash; Changes in the Language</A>
129 <LI><A HREF="manual.html#8.2">8.2 &ndash; Changes in the Libraries</A> 126 <LI><A HREF="#8.2">8.2 &ndash; Changes in the Libraries</A>
130 <LI><A HREF="manual.html#8.3">8.3 &ndash; Changes in the API</A> 127 <LI><A HREF="#8.3">8.3 &ndash; Changes in the API</A>
131 </UL> 128 </UL>
132 <P> 129 <P>
133 <LI><A HREF="manual.html#9">9 &ndash; The Complete Syntax of Lua</A> 130 <LI><A HREF="#9">9 &ndash; The Complete Syntax of Lua</A>
134 </UL> 131 </UL>
135 132
136 133
137 <h1>1 &ndash; <a name="1">Introduction</a></h1> 134 <h1>1 &ndash; <a name="1">Introduction</a></h1>
138 135
176 this document is dry in places. 173 this document is dry in places.
177 For a discussion of the decisions behind the design of Lua, 174 For a discussion of the decisions behind the design of Lua,
178 see the technical papers available at Lua's web site. 175 see the technical papers available at Lua's web site.
179 For a detailed introduction to programming in Lua, 176 For a detailed introduction to programming in Lua,
180 see Roberto's book, <em>Programming in Lua</em>. 177 see Roberto's book, <em>Programming in Lua</em>.
181
182 178
183 179
184 <h1>2 &ndash; <a name="2">Basic Concepts</a></h1> 180 <h1>2 &ndash; <a name="2">Basic Concepts</a></h1>
185 181
186 <p> 182 <p>