Light User Data

lua-users home
wiki

Difference (from prior author revision) (no other diffs)

Changed: 6c6
* Light userdata have the semantics of values, while heavy userdata have the semantics of objects. Objects have a unique identity [1]: Two heavy userdata constructed with the same data will always be distinguishable (e.g. rawequal will differentiate them by memory address); two light userdata such constructed will never be distinguishable because they are compared by value not by address.
* Light userdata have the semantics of values, while heavy userdata have the semantics of objects. Objects have a unique identity [1]: Two heavy userdata constructed with the same data will always be distinguishable (e.g. rawequal will differentiate them by memory address); two light userdata so constructed will never be distinguishable because they are compared by value not by address.

Light userdata, like heavy userdata, are a form of userdata, which is one of the basic data types in Lua [1]. Light userdata are characterized by the following properties:

Some interesting points:

--DavidManura

See Also

[1] ProgrammingInLua?, Section 28.5 "Light Userdata".

RecentChanges · preferences
edit · history
Last edited August 4, 2011 2:56 am GMT (diff)