[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: A review of changes between 5.1 and 5.2-work3
- From: Roberto Ierusalimschy <roberto@...>
- Date: Fri, 21 May 2010 15:03:45 -0300
> 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