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
Overview of Lua
- Brief historical background
- Objectives, features, and limitations of Lua
- Accessing Lua documentation and tutorials
- Installing the Lua interpreter
- Configuring and utilizing LuaRocks
Core syntax and meaning
- Variable identifiers
- Comments and block comments
- Global variables and strict mode enforcement
- Local variables
- Standalone scripts and command-line arguments
- Compilation units, chunks, expressions, and semicolons
Primitive types and structural data
- Core types: nil, boolean, number, string
- Object types: function, userdata, thread, table
- Reference objects versus primitive values
- The central role of tables in Lua
Understanding tables and their flexibility
- Tables used as associative arrays
- Tables as numeric arrays or sequences
Core control flow
- Conditional logic: if, then, elseif, else, end
- While loops
- Repeat loops
- Basic for loops
Managing errors
- Distinguishing return values from exceptions
- Converting return values into exceptions
- Converting exceptions into return values
- Error levels
Practical applications
- Evaluating polynomials
- Breadth-first search algorithms
- Supplementary exercises
Advanced function concepts
- 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
- Distinguishing between iterators and co-routines
Metatables and metamethods
- The set data structure example
- The __tostring metamethod
- Arithmetic operations via metamethods
- The __index and __newindex metamethods
- The __len metamethod
Modules and packaging
- Utilizing existing modules
- Developing custom modules
- Grouping modules into packages
Object-oriented programming
- Foundational OOP concepts in Lua
- Practical examples
Advanced language capabilities
- Weak tables
- Finalizers
- Compilation, evaluation, and dynamic loading
Requirements
Experience with at least one other programming language is required. A foundational understanding of programming concepts is essential. Additionally, prior exposure to other scripting languages will facilitate a smoother transition to learning Lua.
14 Hours