Get in Touch

Course Outline

Introduction to Lua

  • Historical background
  • Lua's objectives, features, and limitations
  • Lua documentation and tutorial resources
  • Installing the Lua interpreter
  • Configuring and utilizing LuaRocks

Basic syntax and semantics

  • Identifiers
  • Single and block comments
  • Global variables and enforcing strict mode
  • Local variables
  • Standalone programs and command-line arguments
  • Compilation units, chunks, expressions, and semicolons

Data types and data structures

  • Basic types: nil, boolean, number, string
  • Object types: function, userdata, thread, table
  • References/objects versus primitive values
  • The central role of tables in Lua

Introduction to tables and their versatility

  • Tables as associative arrays
  • Tables as numeric arrays and sequences

Basic control structures

  • if-then-elseif-else-end constructs
  • While loops
  • Repeat-until loops
  • Simple for loops

Error handling

  • Return values versus exceptions
  • Converting return values to exceptions
  • Converting exceptions to return values
  • Understanding error levels

Example programs

  • Polynomial evaluation
  • Breadth-first search implementation
  • Additional practice exercises

Deeper dive into functions

  • Named arguments
  • Object-oriented method calls
  • Closures
  • Currying
  • Tail calls
  • Multiple assignment and return values
  • Varargs (variable arguments)

Iterators and coroutines

  • Generic for loops
  • Stateless versus stateful iterators
  • Differences between iterators and coroutines

Metatables and metamethods

  • Implementing sets
  • The __tostring metamethod
  • Arithmetic metamethods
  • The __index and __newindex metamethods
  • The __len metamethod

Modules and packages

  • Using existing modules
  • Creating custom modules
  • Organizing modules into packages

Object-oriented programming

  • Core building blocks of OOP in Lua
  • Practical examples

Advanced language features

  • Weak tables
  • Finalizers
  • Compilation, evaluation, and loading mechanisms

Requirements

Participants should have prior familiarity with at least one other programming language, along with general programming experience. Optionally, prior exposure to other scripting languages can facilitate a smoother understanding of Lua.

 14 Hours

Number of participants


Price per participant

Upcoming Courses

Related Categories