Get in Touch
 Duration 14 hours

Course Outline

Getting Started with Lua

  • A brief historical overview
  • Design objectives, key features, and non-goals of Lua
  • Accessing Lua documentation and tutorials
  • Installation of the Lua interpreter
  • Configuring and utilizing LuaRocks

Fundamental Syntax and Semantics

  • Identifier rules
  • Single-line and block comments
  • Managing global variables and enforcing strict mode
  • Declaring local variables
  • Creating standalone programs and handling arguments
  • Understanding 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 basic values
  • The central role of tables in Lua

Tables and Their Versatility

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

Core Control Flow

  • Conditional logic: if, then, elseif, else, end
  • The while loop structure
  • The repeat loop structure
  • The basic for loop

Managing Errors

  • Comparing return values against exceptions
  • Transforming return values into exceptions
  • Converting exceptions back to return values
  • Understanding error levels

Practical Examples

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

Advanced Function Concepts

  • Using named arguments
  • Object-oriented invocation styles
  • Working with closures
  • Techniques for currying
  • Tail calls and their implications
  • Handling multiple assignments and return values
  • Utilizing varargs

Iterators and Coroutines

  • The generic for loop mechanism
  • Contrasting stateless and stateful iterators
  • Distinguishing between iterators and coroutines

Metatables and Metamethods

  • Implementing a set using metatables
  • The __tostring metamethod
  • Overriding arithmetic operations
  • The __index and __newindex metamethods
  • The __len metamethod

Modules and Packaging

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

Object-Oriented Programming

  • Foundational building blocks of OOP in Lua
  • Practical implementation examples

Advanced Language Features

  • Managing weak tables
  • Working with finalizers
  • Processes for compilation, evaluation, and loading

Requirements

Students should have working knowledge of at least one other programming language, along with general programming experience. While not required, prior familiarity with other scripting languages will facilitate a smoother transition to understanding 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 2900 € + VAT*

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

Upcoming Courses

Related Categories