Course Outline

Introduction to Lua for Government

  • A brief history of Lua
  • Lua's goals, features, and non-goals
  • Resources for Lua documentation and tutorials
  • Installing the Lua interpreter
  • Setting up and using LuaRocks

Basic Syntax and Semantics for Government

  • Identifiers
  • Comments and block comments
  • Global variables and enforcement of strictness
  • Local variables
  • Standalone programs and program arguments
  • Compilation units, chunks, expressions, and semicolons

Data Types and Data Structures for Government

  • Basic types: nil, boolean, number, string
  • Object types: function, userdata, thread, table
  • References/objects vs. basic values
  • The importance of tables in Lua

Introduction to Tables and Their Versatility for Government

  • Tables as associative arrays
  • Tables as numeric arrays, sequences

Basic Control Structures for Government

  • The if then elseif else end structure
  • The while loop
  • The repeat loop
  • The simple for loop

Error Handling for Government

  • Return values vs. exceptions
  • Converting a return value to an exception
  • Converting an exception to a return value
  • Error levels

Example Programs for Government

  • Polynomial evaluation
  • Breadth-first search
  • Additional exercises

More About Functions for Government

  • Named arguments
  • Object-oriented calls
  • Closures
  • Currying
  • Tail calls
  • Multiple assignment and return values
  • Varargs

Iterators and Co-routines for Government

  • The generic for loop
  • Stateless vs. stateful iterators
  • Differences between iterators and co-routines

Metatables and Metamethods for Government

  • The set example
  • The __tostring metamethod
  • Arithmetic metamethods
  • The __index, __newindex metamethods
  • The __len metamethod

Modules and Packages for Government

  • Using modules
  • Creating modules
  • Organizing modules into packages

Object-Oriented Programming for Government

  • The building blocks of OOP in Lua
  • Examples

Discussion on More Advanced Language Features for Government

  • Weak tables
  • Finalizers
  • Compilation, eval, and loading

Requirements

Familiarity with at least one additional programming language is required. Experience in programming is essential. Optionally, having knowledge of other scripting languages can facilitate a better understanding of Lua for government applications.

 14 Hours

Number of participants


Price per participant

Upcoming Courses

Related Categories