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
Overview of Lua
- Brief historical background
- Design objectives, key features, and limitations
- Access to official documentation and tutorial resources
- Procedure for installing the Lua interpreter
- Configuration and utilization of LuaRocks
Core Syntax and Semantic Rules
- Definition of identifiers
- Implementation of comments and block comments
- Management of global variables and strict mode enforcement
- Scope of local variables
- Structure of standalone programs and argument handling
- Concepts of compilation units, chunks, expressions, and semicolons
Data Types and Structural Elements
- Primitive types: nil, boolean, number, string
- Object types: function, userdata, thread, table
- Distinction between references/objects and primitive values
- The central role of tables in the Lua ecosystem
Table Architecture and Versatility
- Using tables as associative arrays
- Using tables as numeric arrays or sequences
Foundational Control Structures
- Conditional logic using if then elseif else end
- The while loop structure
- The repeat loop structure
- The basic for loop
Error Management Strategies
- Comparing return values with exceptions
- Transforming return values into exceptions
- Transforming exceptions into return values
- Understanding error levels
Practical Program Examples
- Evaluation of polynomials
- Breadth-first search algorithms
- Supplementary practice exercises
Advanced Function Concepts
- Usage of named arguments
- Object-oriented invocation patterns
- Concepts of closures
- Currying techniques
- Optimization via tail calls
- Multiple assignment and return values
- Handling variable arguments (varargs)
Iterators and Coroutines
- Mechanics of the generic for loop
- Comparison of stateless and stateful iterators
- Distinctions between iterators and coroutines
Metatables and Metamethods
- Implementing set operations as a case study
- Application of the __tostring metamethod
- Overriding arithmetic operations via metamethods
- Usage of __index and __newindex metamethods
- Implementation of the __len metamethod
Modular Architecture and Packages
- Integrating external modules
- Development of custom modules
- Structuring modules within packages
Object-Oriented Programming in Lua
- Core components enabling OOP in Lua
- Practical implementation examples
Exploration of Advanced Language Capabilities
- Utilization of weak tables
- Implementation of finalizers
- Processes of compilation, evaluation, and code loading
Requirements
A foundational understanding of at least one other programming language is required, along with general programming experience. While not mandatory, prior familiarity with other scripting languages can facilitate a smoother transition to Lua.