1 <!-- lua.man,v 1.8 2003/04/02 00:05:20 lhf Exp -->
4 <TITLE>LUA man page
</TITLE>
7 <BODY BGCOLOR=
"#FFFFFF">
24 is the stand-alone Lua interpreter.
25 It loads and executes Lua programs,
26 either in textual source form or
27 in precompiled binary form.
28 (Precompiled binaries are output by
32 can be used as a batch interpreter and also interactively.
38 the Lua program in file
40 is loaded and executed.
45 as strings in a global table named
47 If these arguments contain spaces or other characters special to the shell,
48 then they should be quoted
49 (but note that the quotes will be removed by the shell).
53 which contains the string
55 The index of the last argument is stored in
57 The arguments given in the command line before
59 including the name of the interpreter,
60 are available in negative indices in
64 before even handling the command line,
66 executes the contents of the environment variable
76 Otherwise, the string is assumed to be a Lua statement and is executed.
80 and are described below.
83 to signal the end of options.
85 If no arguments are given,
88 is assumed when the standard input is a terminal;
96 reads lines from the standard input,
97 and executes them as they are read.
98 If a line does not contain a complete statement,
99 then a secondary prompt is displayed and
100 lines are read until a complete statement is formed or
101 a syntax error is found.
102 So, one way to interrupt the reading of an incomplete statement is
103 to force a syntax error:
106 in the middle of a statement is a sure way of forcing a syntax error
107 (except inside multiline strings and comments; these must be closed explicitly).
108 If a line starts with
112 displays the values of all the expressions in the remainder of the
113 line. The expressions must be separated by commas.
114 The primary prompt is the value of the global variable
116 if this value is a string;
117 otherwise, the default prompt is used.
118 Similarly, the secondary prompt is the value of the global variable
121 to change the prompts,
122 set the corresponding variable to a string of your choice.
123 You can do that after calling the interpreter
124 or on the command line with
125 <B>"_PROMPT" "=\'lua: \'"</B>,
127 (Note the need for quotes, because the string contains a space.)
128 The default prompts are ``
> '' and ``
>> ''.
132 load and execute the standard input as a file,
135 even when the standard input is a terminal.
137 <B>-e
"</B><I>stat"</I>
142 if it contains spaces, quotes,
143 or other characters special to the shell.
146 enter interactive mode after
150 <B>-l
"</B><I>file"</I>
152 <B>require( file
</B><I>)
</I>
155 Typically used to load libraries
160 show version information.
164 <A HREF=
"http://www.lua.org/">http://www.lua.org/
</A>
166 Error messages should be self explanatory.
172 (
<A HREF=
"mailto:lua-NO-SPAM-THANKS@tecgraf.puc-rio.br">lua AT tecgraf.puc-rio.br
</A>)