Tables and Objects

The only data structure provided by Lua is the table. As discussed in Chapter 2, Working with Lua, the table is one of the built-in data types Lua provides. Tables are powerful enough to implement other data structures, such as lists, queues, or stacks.

Lua is not object-oriented; the language does not have support for objects. However, using tables and meta-tables, an object system can be implemented from the ground up. By the end of this chapter, you will have implemented an object system in Lua.

This chapter will cover the following topics:

  • Introduction to tables
  • Arrays
  • Iterating
  • Meta tables
  • Objects
  • Inheritance
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.143.255.36