Professional Documents
Culture Documents
Programming in Lua - 7.5
Programming in Lua - 7.5
Programming in Lua
Part I. The Language
Chapter 7. Iterators and the Generic for
As a concrete example,
let us rewrite once more the allwords iterator using
this style:
for l in io.lines() do
f(w)
end
end
end
allwords(print)
allwords(function (w)
end)
print(count)
local count = 0
for w in allwords() do
end
print(count)