Luart
Comprehensive Windows framework to develop in Lua
modules > basic > Object

Object ( from )

Declare a new Object type using the from prototype. The Object function implements single inheritance object oriented programming in Lua.

Parameters

from

A table or an other previously declered Object that serves as a prototype to define a new custom type.

Return value

Returns the new defined Object type.

Example


Polygon = Object {
	sides = 0
}

-- outputs "Object"
print(type(Polygon))