Thank you for sending your enquiry! One of our team members will contact you shortly.
Thank you for sending your booking! One of our team members will contact you shortly.
Duration 14 hours
Course Outline
Getting Started with Lua
- Brief historical context
- Lua's design goals, key features, and limitations
- Accessing official documentation and tutorials
- Installing the Lua interpreter
- Configuring and utilizing LuaRocks
Core Syntax and Semantics
- Identifiers
- Single-line and block comments
- Global variables and strict mode enforcement
- Local variables
- Standalone scripts and handling program arguments
- Compilation units, chunks, expressions, and semicolons
Data Types and Structures
- Primitive types: nil, boolean, number, string
- Reference types: function, userdata, thread, table
- Distinguishing between references/objects and basic values
- The central role of tables in Lua
Exploring Table Versatility
- Using tables as associative arrays
- Using tables as numeric arrays and sequences
Foundational Control Structures
- Conditional logic with if, then, elseif, else, end
- While loops
- Repeat loops
- Simple for loops
Error Management
- Comparing return values with exceptions
- Converting return values into exceptions
- Converting exceptions into return values
- Understanding error levels
Practical Programming Examples
- Evaluating polynomials
- Breadth-first search algorithms
- Supplementary exercises
Advanced Function Concepts
- Named arguments
- Object-oriented function calls
- Closures
- Currying
- Tail calls
- Multiple assignment and return values
- Variable-length argument lists (varargs)
Iterators and Coroutines
- The generic for loop
- Stateless versus stateful iterators
- Distinguishing between iterators and coroutines
Metatables and Metamethods
- Implementing sets as an example
- The __tostring metamethod
- Arithmetic metamethods
- The __index and __newindex metamethods
- The __len metamethod
Modules and Packages
- Utilizing existing modules
- Building custom modules
- Structuring modules into packages
Object-Oriented Programming
- Core building blocks of OOP in Lua
- Practical examples
Advanced Language Features
- Weak tables
- Finalizers
- Compilation, evaluation, and loading
Requirements
A working knowledge of at least one other programming language and general coding experience are required. Prior familiarity with scripting languages is optional but will facilitate a smoother understanding of Lua concepts.