Difference between revisions of "Variant"
m (→Notes: list notation) |
(Clarified restrictions for usage of tables as Variant) |
||
Line 7: | Line 7: | ||
* Foreign userdata (Lua's files, LuaSocket, ENet, ...), functions and <code>nil</code> are not supported. | * Foreign userdata (Lua's files, LuaSocket, ENet, ...), functions and <code>nil</code> are not supported. | ||
− | * | + | * There are various restrictions on using tables for Variant: |
− | + | ** Values within a table are also subject to the Variant rules (i.e. must only contain Variant types). | |
− | * Values within a table are also subject to the Variant rules (i.e. must only contain Variant types). | + | ** Tables will lose their metatables when used as a Variant. |
+ | ** Prior to [[11.0]] nested tables are not officially supported. | ||
+ | ** Nested tables cannot have cyclical references | ||
== See Also == | == See Also == |
Latest revision as of 21:59, 22 June 2024
The Variant type is not a real lua type, but instead indicates what lua values LÖVE can store internally. It is used in love.thread and love.event. Indeed, as it is a "virtual" type, it has no specific representation in lua, and no methods.
Contents
Types
A Variant can be a table, a boolean, a string, a number or LÖVE Objects.
Notes
- Foreign userdata (Lua's files, LuaSocket, ENet, ...), functions and
nil
are not supported.
- There are various restrictions on using tables for Variant:
- Values within a table are also subject to the Variant rules (i.e. must only contain Variant types).
- Tables will lose their metatables when used as a Variant.
- Prior to 11.0 nested tables are not officially supported.
- Nested tables cannot have cyclical references
See Also
Other Languages
Dansk –
Deutsch –
English –
Español –
Français –
Indonesia –
Italiano –
Lietuviškai –
Magyar –
Nederlands –
Polski –
Português –
Română –
Slovenský –
Suomi –
Svenska –
Türkçe –
Česky –
Ελληνικά –
Български –
Русский –
Српски –
Українська –
עברית –
ไทย –
日本語 –
正體中文 –
简体中文 –
Tiếng Việt –
한국어
More info