lua-users home
lua-l archive

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

It's funny you mentioned it though, because the first time it did that to me I was surprised too. I'm guessing it's because it's easier to print that way. Imagine reading the output of an escaped 100kB text file otherwise. It definitely doesn't modify the strings \n's to the host systems variants - that would be counterproductive. (I check lstrlib just to be sure)

- Alex

----- Original Message ----- From: "Doug Rogers" <>

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?