Lua Book

Pete Shinners pete at shinners.org
Tue Mar 2 10:13:02 EST 2004


Cameron Laird wrote:
> Incidentally, have you heard the news about Lua?  Look at
> <URL: http://www.inf.puc-rio.br/~roberto/book/ >.

I have no experience with Lua, but some of the code examples from the book 
may frighten me away for good.

http://www.inf.puc-rio.br/~roberto/book/code/allwords.lua.html



I suppose Python's recent introduction of generators makes this rather trivial.

def allwords():
     for line in sys.stdin:
         for word in line.split():
             yield word

for word in allwords():
     print word






More information about the Python-list mailing list