Get in Touch

Course Outline

Introduction to Lua

  • Historical background
  • Lua's objectives, key features, and excluded goals
  • Accessing Lua documentation and tutorial resources
  • Installing the Lua interpreter
  • Setting up and utilizing LuaRocks

Basic Syntax and Semantics

  • Identifier rules
  • Comments and block comments
  • Global variables and enforcing strict mode
  • Local variables
  • Running standalone programs and handling command-line arguments
  • Compilation units, chunks, expressions, and semicolons

Data Types and Structures

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

Understanding Tables and Their Versatility

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

Control Structures

  • Conditional statements: if, then, elseif, else, end
  • While loops
  • Repeat loops
  • Standard for loops

Error Handling

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

Example Programs

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

Advanced Function Concepts

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

Iterators and Coroutines

  • The generic for loop
  • Differences between stateless and stateful iterators
  • Key distinctions between iterators and coroutines

Metatables and Metamethods

  • Using sets as an example
  • The __tostring metamethod
  • Arithmetic metamethods
  • The __index and __newindex metamethods
  • The __len metamethod

Modules and Packages

  • Implementing modules
  • Creating custom modules
  • Organizing modules into packages

Object-Oriented Programming

  • Core components of OOP in Lua
  • Practical examples

Advanced Language Features

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

Requirements

Prerequisites include familiarity with at least one other programming language and prior programming experience. While not mandatory, having experience with other scripting languages can facilitate a smoother learning curve for understanding Lua.

 14 Hours

Number of participants


Price per participant

Upcoming Courses

Related Categories