Get in Touch
 Duration 14 hours

Course Outline

Introduction to Lua

  • Historical background
  • Objectives, features, and non-objectives of Lua
  • Documentation and tutorial resources
  • Installation of the Lua interpreter
  • Configuration and usage of LuaRocks

Core syntax and semantics

  • Variable identifiers
  • Comments and block comments
  • Global variables and enforcing strict mode
  • Local variable scope
  • Standalone program execution and command-line arguments
  • Compilation units, chunks, expressions, and semicolons

Data types and structures

  • Primitive types: nil, boolean, number, string
  • Reference types: function, userdata, thread, table
  • Differences between references/objects and basic values
  • The central role of tables in Lua

Tables and their flexibility

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

Foundational control structures

  • Conditional logic using if, then, elseif, else, and end
  • Execution with while loops
  • Utilization of repeat loops
  • Basic for loop implementation

Managing errors

  • Distinction between return values and exceptions
  • Transforming return values into exceptions
  • Catching exceptions as return values
  • Managing error levels

Practical examples

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

Advanced function concepts

  • Usage of named arguments
  • Object-oriented function calling conventions
  • Working with closures
  • Understanding currying
  • Tail call optimization
  • Handling multiple assignments and returns
  • Managing variable arguments (varargs)

Iterators and coroutines

  • Implementing the generic for loop
  • Comparing stateless and stateful iterators
  • Distinguishing between iterators and coroutines

Metatables and metamethods

  • Demonstrating set operations
  • Applying the __tostring metamethod
  • Implementing arithmetic metamethods
  • Using __index and __newindex metamethods
  • Utilizing the __len metamethod

Modules and packages

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

Object-oriented programming

  • Core components of OOP in Lua
  • Practical implementation examples

Discussion on advanced language features

  • Implementation of weak tables
  • Use of finalizers
  • Processes for compilation, evaluation, and loading

Requirements

A solid understanding of at least one other programming language is required, along with general programming experience. While not mandatory, prior familiarity with other scripting languages can facilitate a smoother transition to Lua.

Custom Corporate Training

Training solutions designed exclusively for businesses.

  • Customized Content: We adapt the syllabus and practical exercises to the real goals and needs of your project.
  • Flexible Schedule: Dates and times adapted to your team's agenda.
  • Format: Online (live), In-company (at your offices), or Hybrid.
Investment

Price per private group, online live training, starting from 2600 € + VAT*

Contact us for an exact quote and to hear our latest promotions

Provisional Upcoming Courses (Contact Us For More Information)

Related Categories