Difference between revisions of "Variant"

m (Bartbes moved page value to Variant: This page really describes love's Variant type)
m (Notes: list notation)
 
(6 intermediate revisions by 6 users not shown)
Line 1: Line 1:
The [[value]] type is used to indicate, that all of Lua's types can be used in a certain place (e.g.: as arguments).  
+
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.
  
It is an artifical type solely created for the wiki and doesn't exist in Lua.
+
== Types ==
 +
A [[Variant]] can be a [[table]], a [[boolean]], a [[string]], a [[number]] or LÖVE [[Object]]s.
 +
 
 +
== Notes ==
 +
* Foreign userdata (Lua's files, LuaSocket, ENet, ...), functions and <code>nil</code> are not supported.
 +
 
 +
* Nested tables are not officially supported in versions prior to [[11.0]].
  
== Types ==
+
* Values within a table are also subject to the Variant rules (i.e. must only contain Variant types).
A [[value]] can be a flat [[table]], a [[boolean]], a [[string]], a [[number]] or LÖVE [[userdata]].  
 
  
== Note ==
+
== See Also ==
Foreign userdata (Lua's files, LuaSocket, ENet, ...), functions, and nested [[table|tables]] are not supported.
+
* [[parent::love]]
 +
[[Category:Types]]
 +
{{#set:Description=The types supported by [[love.thread]] and [[love.event]].}}
 +
{{#set:Since=000}}
  
 
== Other Languages ==
 
== Other Languages ==
{{i18n|value}}
+
{{i18n|Variant}}

Latest revision as of 02:59, 23 June 2023

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.

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.
  • Nested tables are not officially supported in versions prior to 11.0.
  • Values within a table are also subject to the Variant rules (i.e. must only contain Variant types).

See Also


Other Languages