class [function]
class( object obj, object metaobj )
sets metaobj
as meta-object for obj
and enables metamethods for obj
, returns obj
- refer to Classes for more information on how class objects work and how to use them
someCommonInterface = { printdata = function(){ print( this.data ); } }; c = class( { data = "5" }, someCommonInterface ); c.data = "6"; c.printdata(); // prints 6