This first edition was written for Lua 5.0. While still largely relevant for Lua 5.1, there are some differences.
The second edition targets Lua 5.1 and is available at Amazon and as an e-book.
By buying the book, you also help to support the Lua project.


10 – Complete Examples

To end this introduction about the language, we show two complete programs that illustrate different facilities of Lua. The first example is a real program from the Lua site; it illustrates the use of Lua as a data description language. The second example is an implementation of the Markov chain algorithm, described by Kernighan & Pike in their book The Practice of Programming (Addison-Wesley, 1999).