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.


4.3.3 – repeat

As the name implies, a repeat-until statement repeats its body until its condition is true. The test is done after the body, so the body is always executed at least once.

    -- print the first non-empty line
    repeat
      line = os.read()
    until line ~= ""
    print(line)