epatrizio / ola

OCaml Lua Interpreter
The Unlicense
1 stars 1 forks source link

oriented object programming : basic example #24

Closed epatrizio closed 2 months ago

epatrizio commented 3 months ago

Object-oriented programming is not part of Lua language, but it is possible thanks to the power of tables and closures. Here is a basic example. For more detailed information and examples: (which requires the use of metatable) https://www.lua.org/pil/16.html https://www.tutorialspoint.com/lua/lua_object_oriented.htm