[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: finding keys in a table
- From: Doug Rogers <rogers@...>
- Date: Thu, 21 Feb 2008 12:15:36 -0500
Alex Davies wrote:
> Imagine reading the output of an escaped 100kB text file
I guess I don't consider that a use case for s:format("%q") but rather a
use case for io.write('[[' .. s .. ']]'). The former only seems useful
when I want to write a short string that is quoted for later reading.
> ----- Original Message ----- From: "Doug Rogers" <email@example.com>
>> It seems like using "\n" would give an exact representation of the
>> string even if it is written to a file that is shared between machines
>> with different line termination characteristics. My experience with this
>> sort of thing is that there was a reason for it, but the only reason I
>> can come up with (allowing multi-line quoted strings) is easily
>> dismissed by using '[['.
>> Is it done this way explicitly so it can automatically pick up the
>> LF/CR+LF of the host system when the string is re-read?
Innovative Concepts, Inc. www.innocon.com 703-893-2007 x220