lua-users home
lua-l archive

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


On Wed, Aug 3, 2011 at 5:46 PM, Dirk Laurie <dpl@sun.ac.za> wrote:
> On Wed, Aug 03, 2011 at 04:32:17PM +0200, Duncan Cross wrote:
>> On Wed, Aug 3, 2011 at 1:45 PM, Luiz Henrique de Figueiredo
>> <lhf@tecgraf.puc-rio.br> wrote:
>> >        load(io.lines"xxx")
>>
>> Doesn't it need to be load(io.lines("xxx", "*L"))?
>>
>
> Not that easy to catch out LHF.  From the manual on `file:lines (···)`
>
>> When no format is given, uses "*l" as a default.

Yep, but "*l" omits the new-line characters at the end of each line -
"*L" preserves them.

If you omit, a file like "a = b<new line>func()" would compile to "a = bfunc()".

-Duncan