28 Jul Roberto Ierusalimschy & Luiz Henrique de Figueiredo & Waldemar Celes. 1. Lua Reference Manual. Abstract. Lua Reference Manual. Roberto Ierusalimschy,. Luiz Henrique de Figueiredo ,. Waldemar Celes. March 26, 1 – Introduction. Lua is an extension. Reference Manual. By Roberto Ierusalimschy, Luiz Henrique de Figueiredo , Waldemar Celes. Original version available at

Author: Maudal Nezuru
Country: Namibia
Language: English (Spanish)
Genre: Sex
Published (Last): 9 April 2013
Pages: 465
PDF File Size: 17.79 Mb
ePub File Size: 2.19 Mb
ISBN: 848-3-62880-368-4
Downloads: 82264
Price: Free* [*Free Regsitration Required]
Uploader: Kigak

All values in Lua are first-class values. There are no flags, widths, or precisions. Returns the current hook settings of the thread, as three values: The following combinations are allowed in describing a character class:. Creates a copy of string s by replacing any occurrence of the string p with the string r.

Lua is a case-sensitive language: The interaction between ranges and classes is not lua 5.1 reference manual.

Lua Reference Manual – errata

For instance, to know in which line a function f was defined, you can lua 5.1 reference manual the following code: The function results are pushed onto the stack when the function returns. This document is from Lua version 5.

If name is a compound name that is, one with components separated by dotsmodule creates or reuses, if they already exist tables for each component.

If the function argument narg is a string, returns this string. The scope of variables begins at the first statement after their declaration and lasts until the end of the innermost block that includes the maunal.


Returns two numbers, the integral part of x and the fractional part of x. The writer returns an error code: The library function type returns a string describing the type of a given value.

If the object does not have a metatable, or lua 5.1 reference manual the metatable does not have this field, returns 0 and pushes nothing. If this function fails, it returns nilplus a string describing the error.

Lua 5.1 Reference Manual

It also returns 0 when called with a non-valid index. On each iteration, the iterator function is called to produce a new value, stopping lua 5.1 reference manual this new value is nil. Contents 1 – Introduction 2 – The Language 2.

The chunkname argument gives a name to the chunk, which is used for error messages and in debug information see 3. Cannot be called with a pseudo-index, because a pseudo-index is not an actual stack position.

Lua Reference Manual

A field in the form x y means the function can push or pop x or y elements, depending on the situation; an interrogation mark ‘? This function never shrinks the stack; if the stack is already larger than the new size, it is left unchanged.

The block must exist until the reader function is called again. Set lua 5.1 reference manual a giveaway. Sets the metatable for the given table. Returns 1 if the value at the given acceptable index is a number or a string convertible to a number, and 0 otherwise. The userdata itself is freed only in the next garbage-collection cycle.


Raises an error with the following message, where func is retrieved from the call lua 5.1 reference manual. String represents arrays lua 5.1 reference manual characters. Tables, functions, threads, and full userdata values are objects: Lua provides automatic conversion between string and number values at run time. The reference ref is also freed to be used again.

This function receives a pointer to a C function and pushes onto the stack a Lua value of type function that, when called, invokes the corresponding C function.

Project Website Temporarily Offline

Returns 1 if the value at the given acceptable index is a userdata either full or light lua 5.1 reference manual, and 0 otherwise. The error message which can actually be a Lua value of any type must be on the stack top. The default is always the current thread.

Accepts any acceptable index, or 0, and sets the stack top to this index. The Debug Interface 4.

If its type does not define a handler for the operation, then Lua tries lua 5.1 reference manual second operand. Pushes the resulting string on the stack and returns it. After the collection, Lua does the equivalent of the following function for each userdata in that list:.