lua-users home
lua-l archive

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


> About point 42: the manual is wrong, io.lines(file, true) doesn't
> work -- you need to use io.lines(file, "*L"). In fact you can do
> this now:
> 
>   for odd,even in io.lines(file, "*l", "*l") do
>     print("odd line:", odd)
>     print("even line:", even)
>   end
> 
> Or this:
> 
>   for a,b,c,tail in io.lines(file, 10, 5, 7, "*l") do
>     -- split a file into fixed length columns
>   end

Yes, io.lines now accept the same arguments that io.read accepts. The
default is *l, as usual. Probably this function should be renamed to
something like 'gread' (similarly to gmatch).

-- Roberto