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 overview
- Core objectives, features, and limitations
- Accessing Lua documentation and tutorial resources
- Installing the Lua interpreter
- Configuring and utilizing LuaRocks
Basic syntax and semantics
- Identifiers
- Inline and block comments
- Global variables and enforcing strict mode
- Local variables
- Standalone scripts and command-line arguments
- Compilation units, chunks, expressions, and semicolon usage
Data types and data structures
- Primitive types: nil, boolean, number, string
- Object types: function, userdata, thread, table
- Distinction between references/objects and primitive values
- The critical role of tables in Lua
Introduction to tables and their versatility
- Tables functioning as associative arrays
- Tables functioning as numeric arrays and sequences
Basic control structures
- if, then, elseif, else, end constructs
- while loops
- repeat loops
- Simple for loops
Error handling
- Comparing return values versus exceptions
- Transforming return values into exceptions
- Transforming exceptions into return values
- Understanding error levels
Example programs
- Polynomial evaluation
- Breadth-first search implementation
- Additional practice exercises
More about functions
- Named arguments
- Object-oriented method calls
- Closures
- Currying
- Tail calls
- Multiple assignment and return values
- Variable arguments (Varargs)
Iterators and co-routines
- The generic for loop
- Stateless versus stateful iterators
- Key differences between iterators and co-routines
Metatables and metamethods
- The set example
- The __tostring metamethod
- Arithmetic metamethods
- The __index and __newindex metamethods
- The __len metamethod
Modules and packages
- Utilizing modules
- Creating custom modules
- Organizing modules into packages
Object-oriented programming
- Foundational elements of OOP in Lua
- Practical examples
Discussion on more advanced language features
- Weak tables
- Finalizers
- Compilation, eval, and loading mechanisms
Requirements
A fundamental understanding of at least one other programming language and some programming experience is required. While optional, prior familiarity with other scripting languages can facilitate a smoother learning curve for Lua.
14 Hours