Imported from ../lua-3.2.tar.gz.
[lua.git] / src / lua / README
blobdb2eafb7e581658e1ff008451773f38dbb3460b6
1 This client is a sample lua interpreter.
2 It can be used as a batch interpreter and also interactively.
4 Here are the options it understands:
6   -v       print version information
7   -d       turn debug on
8   -e stat  dostring `stat'
9   -q       interactive mode without prompt
10   -i       interactive mode with prompt
11   -        executes stdin as a file
12   a=b      sets global `a' with string `b' (no need to quote b)
13   name     dofile `name'
15 If no options are given, then it reads lines from stdin and executes them
16 as they are read.  So, each line must contain a complete statement.
17 To span a statement across several lines, end each line with a backslash '\'.
19 To change the prompt, set the global variable _PROMPT to whatever you want.
20 You can do after calling the interpreter or on the command line with
21         _PROMPT="lua: "
22 for example.
24 You must be careful when using quotes on the command line because they are
25 usually handled by the shell.
27 This interpreter is good for using Lua as a standalone language.
28 For a minimal interpreter, see etc/min.c.
30 If your application simply exports new functions to Lua (which is common),
31 then you can use this interpreter unmodified: just define a function
33         void lua_userinit (void)
35 in your code. In this function, you should do whatever initializations are
36 need, typically exporting your functions to Lua.
37 If you use this scheme, you must explicily open any standard libraries you need.
38 See ../lib/linit.c