Learning Lua (2025-06-15)

Let’s learn Lua


In Lua, everything in the standard library, including io, math, os, etc., is implemented as a table.

So:

io.open

means “look up the key 'open' in the table io.”

Think of io as a namespace table holding related functions:

io = {
  open = function(...) ... end,
  write = function(...) ... end,
  ...
}

This design gives Lua flexibility—libraries are just tables. You can inspect, override, or extend them easily.