Functional programming in Lua