The Carbon documentation refers to some types that may be uncommon to some Lua users. Types in the documentation with
lowercase names can be found here.
Standard Lua Types
These are types representable by the Lua
type function, some by different names.
This is a standard string type containing text or data.
This is any number, including
A value representing
false. Lua knows these as
An explicitly empty, or non-existent value.
This refers to a table with any structure. Tables have two types of data storage, the list and dictionary parts. The list part may be traversed with
ipairs, while the dictionary part (which is a superset of the list part) can be traversed with
Generated by C methods or through the
A Lua coroutine, generated by a few different standard Lua functions.
A loose grouping of values used when returning multiple values. A
tuple<N, x, y, z> denotes the length and constituent types of the tuple.
Extended Lua Types
These types are non-standard subsets of the standard array of Lua types. They specify more specific variants of the above primitives.
(x, y, z)
A conglomerate type indicating that this type can be any of the types
x is any other type, represnts that type or
nil. Known as a "nullable" type, since types are non-nullable by default.
This is the same as
Many types can be represented in a 'loose' form, often used for intermediate conversions to prevent allocations.
A generic type that any other type can fill.
Denotes a type designed for the LuaJIT FFI. Only available under LuaJIT.
An explicitly empty, or non-existent value. This is used in place of
nil for method signatures.
table, or a
userdata with an
__index metamethod. These types can have their members without throwing errors.
An unsigned, positive
An unsigned, positive
A table with data in the list part. Data can also exist in the dictionary part of the array, but it will not be used. A list can specify the types of its values, in the form of
table with data in the list or dictionary parts. A dictionary can specify the types of its keys and values, in the form of
An alias to
dictionary<any, bool>, that is, a dictionary whose keys can be anything, but whose values must be boolean. A
set is said to be "explicit" if it contains both
false members, explicitly excluding members from the set by name.
Sets can override the default key type of
any using the form