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
- Brief history
- Design goals, features, and limitations
- Documentation and tutorial resources
- Installation of the Lua interpreter
- Configuration and usage of LuaRocks
Basic syntax and semantics
- Identifiers
- Comments and block comments
- Global variables and strictness enforcement
- Local variables
- Standalone programs and argument handling
- Compilation units, chunks, expressions, and semicolons
Data types and data structures
- Primitive types: nil, boolean, number, string
- Object types: function, userdata, thread, table
- Distinguishing references/objects from primitive values
- The central role of tables in Lua
Introduction to tables and their versatility
- Tables as associative arrays
- Tables as numeric arrays and sequences
Basic control structures
- The if, then, elseif, else, end structure
- The while loop
- The repeat loop
- The simple for loop
Error handling
- Return values versus exceptions
- Converting return values into exceptions
- Converting exceptions into return values
- Error levels
Example programs
- Polynomial evaluation
- Breadth-first search
- Supplementary exercises
More about functions
- Named arguments
- Object-oriented invocation styles
- Closures
- Currying
- Tail calls
- Multiple assignment and return
- Varargs
Iterators and co-routines
- The generic for loop
- Stateless versus stateful iterators
- Distinguishing between iterators and co-routines
Metatables and metamethods
- Implementing the set data structure
- 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
- Fundamental OOP components in Lua
- Practical examples
Discussion on more advanced language features
- Weak tables
- Finalizers
- Compilation, eval, and loading mechanisms
Requirements
Proficiency in at least one other programming language is required. General programming experience is expected. Prior familiarity with other scripting languages is optional but can facilitate a smoother understanding of Lua.
14 Hours