Get in Touch
 Duration 14 hours

Course Outline

Overview of Lua

  • Historical background
  • Design goals, features, and intentional exclusions
  • Key documentation and tutorial resources
  • Installation of the Lua interpreter
  • Configuration and usage of LuaRocks

Foundational Syntax and Semantics

  • Identifier conventions
  • Comments and block commenting
  • Global variables and strictness enforcement
  • Local variable scope
  • Standalone scripts and command-line arguments
  • Compilation units, chunks, expressions, and semicolons

Data Types and Structures

  • Primitive types: nil, boolean, number, string
  • Object types: function, userdata, thread, table
  • Reference semantics vs. value types
  • The central role of tables in Lua

Exploring Tables and Their Flexibility

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

Essential Control Flow

  • Conditional logic: if, then, elseif, else, end
  • While loops
  • Repeat loops
  • Basic for loops

Managing Errors

  • Return values vs. exception handling
  • Converting return values into exceptions
  • Converting exceptions into return values
  • Error level management

Practical Examples

  • Polynomial evaluation algorithms
  • Breadth-first search implementation
  • Supplementary practice problems

Advanced Functionality

  • Named argument handling
  • Object-oriented method calls
  • Working with closures
  • Function currying
  • Tail call optimization
  • Multiple assignment and return values
  • Variable arguments (varargs)

Iterators and Co-routines

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

Metatables and Metamethods

  • Implementing sets as a case study
  • The __tostring metamethod
  • Arithmetic metamethods
  • __index and __newindex hooks
  • The __len metamethod

Modular Design and Packages

  • Utilizing existing modules
  • Developing custom modules
  • Structuring modules into packages

Object-Oriented Programming

  • Core OOP building blocks in Lua
  • Implementation examples

Advanced Language Features

  • Weak reference tables
  • Finalizer implementation
  • Runtime compilation, evaluation, and loading

Requirements

Prior experience with programming is required, specifically familiarity with at least one other language. While not mandatory, existing knowledge of other scripting languages will facilitate a smoother understanding of Lua's concepts.

Number of participants


Price per participant

Upcoming Courses

Related Categories