lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

I like the new nexti function and the stateful for loops, but is there a 
simpler way than this to read the lines from a file:

    local f =,'r')
    for line in function() return f:read() end do

If I use "for line in, f do print(line) end", then the call to read 
gets the variable 'line' passed to it and it complains.

just curious,

- Peter