Get in Touch

Course Outline

Introduction to Lua

  • Historical background
  • Objectives, key features, and design limitations
  • Accessing official documentation and tutorials
  • Installing the Lua interpreter
  • Configuring and utilizing LuaRocks

Core syntax and semantics

  • Variable naming conventions
  • Single-line and multi-line comments
  • Global scope and enforcing strict mode
  • Local scope variables
  • Writing standalone scripts and handling arguments
  • Compilation units, chunks, expressions, and semicolon usage

Data types and structures

  • Primitive types: nil, boolean, number, string
  • Complex types: function, userdata, thread, table
  • Distinguishing between references/objects and primitive values
  • The central role of tables in Lua programming

Table versatility

  • Using tables as associative arrays
  • Using tables as numeric sequences or lists

Control flow structures

  • Conditional logic (if, then, elseif, else, end)
  • While loops
  • Repeat-until loops
  • Basic for loops

Error management

  • Differences between return values and exceptions
  • Transforming return values into exceptions
  • Transforming exceptions into return values
  • Understanding error levels

Practical examples

  • Evaluating polynomials
  • Implementing breadth-first search
  • Supplementary practice exercises

Advanced function concepts

  • Named arguments
  • Object-oriented invocation methods
  • Closures
  • Currying techniques
  • Tail calls
  • Multiple assignment and return values
  • Variable arguments (varargs)

Iterators and co-routines

  • The generic for loop
  • Stateless vs. stateful iterator patterns
  • Distinguishing between iterators and co-routines

Metatables and metamethods

  • Implementing a set data structure
  • The __tostring metamethod
  • Arithmetic operation overloading
  • The __index and __newindex metamethods
  • The __len metamethod

Modules and packages

  • Incorporating existing modules
  • Creating custom modules
  • Structuring modules into packages

Object-oriented programming

  • Foundational OOP components in Lua
  • Implementation examples

Advanced language features

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

Requirements

Proficiency in at least one other programming language and general coding experience are required. Prior exposure to other scripting languages is optional but recommended, as it facilitates a smoother transition to understanding Lua.

 14 Hours

Number of participants


Price per participant

Upcoming Courses

Related Categories