lua-users home
lua-l archive

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


On Fri, Feb 26, 2010 at 2:11 PM, Duncan Cross <duncan.cross@gmail.com> wrote:
> + Add a new function, a generalised form of io.lines(), something like
> io.reader(filename, format) where 'format' is the same kind of thing
> as the argument(s) passed to file:read(). If you pass "*l", the
> iterator returned is identical to one created by io.lines() (and would
> have the same problem); you could instead pass a number or "*a", which
> would create an iterator that would not strip the newlines.

Very nice, and useful in other contexts.  For instance, to go over all
the numbers in a file.

steve d.