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.
Course Outline
Introduction to Lua
- Historical background
- Objectives, key features, and design limitations
- Access to official documentation and tutorials
- Installation of the Lua interpreter
- Setup and utilization of LuaRocks
Core syntax and semantics
- Identifier conventions
- Single-line and block comments
- Global variables and enforcing strictness
- Local variable scope
- Standalone program structure and argument handling
- Compilation units, chunks, expressions, and semicolon usage
Data types and data structures
- Primitive types: nil, boolean, number, string
- Object types: function, userdata, thread, table
- Distinguishing between references/objects and primitive values
- The central role of tables in Lua
Tables: Introduction and versatility
- Using tables as associative arrays
- Using tables as numeric arrays and sequences
Basic control structures
- Conditional logic: if, then, elseif, else, end
- While loops
- Repeat loops
- Simple for loops
Error handling
- Return values versus exception models
- Transforming return values into exceptions
- Transforming exceptions into return values
- Managing error levels
Practical program examples
- Polynomial evaluation
- Breadth-first search implementation
- Supplementary practice exercises
Advanced function concepts
- Named arguments
- Object-oriented invocation patterns
- Closures
- Currying techniques
- Tail call optimization
- Multiple assignment and return values
- Variable-length argument lists (Varargs)
Iterators and coroutines
- Generic for loop mechanisms
- Stateless versus stateful iterator designs
- Distinguishing between iterators and coroutines
Metatables and metamethods
- Implementing sets as a practical example
- The __tostring metamethod
- Arithmetic operation metamethods
- The __index and __newindex metamethods
- The __len metamethod
Modules and packages
- Utilizing existing modules
- Creating custom modules
- Structuring modules into packages
Object-oriented programming
- Core OOP building blocks in Lua
- Practical implementation examples
Advanced language features
- Weak table references
- Object finalizers
- Compilation, evaluation, and dynamic loading
Requirements
Proficiency in at least one other programming language is required, along with general programming experience. Additionally, prior exposure to other scripting languages is optional but beneficial for accelerating the understanding of Lua concepts.
14 Hours