Types#
Lua has eight base types and one composite. Values carry their
type; variables do not. type(x) returns the type tag as a
string.
For the syntax of literals, see Syntax. For operators that act on these values, see Operators.
The catalog#
Type |
What it holds |
|---|---|
|
The absence of a value. |
|
|
|
5.3+ distinguishes |
|
Immutable byte sequence. |
|
First-class; Lua and C functions are both this type. |
|
The one composite type. |
|
Opaque blob owned by C code. |
|
A coroutine handle. |
Pages#
The absence of a value.
Falsy is only false and nil.
Integer vs float subtypes (5.3+).
Immutable byte sequences; not Unicode.
The one composite type; array, map, record.
First-class values; Lua and C functions.
Opaque host-side blob.
Coroutine handle.
tostring / tonumber and the few implicit conversions.
References#
Syntax for the literal forms behind each type.
Operators for arithmetic, comparison, and concat semantics per type.
Data Structures for the patterns tables support.
Functions for first-class functions and closures.
Concurrency for the
threadtype and coroutines.