RE: Backslash n [OT] was Line Separator and Paragraph Separator

From: Kent Karlsson (kentk@cs.chalmers.se)
Date: Wed Oct 22 2003 - 09:44:06 CST


Peter Kirk wrote:

> But if two files each consist of one or more lines of text
> separated by
> LS (but with no final LS), when they are concatenated, surely
> LS must be
> added as a separator. Similarly with paragraphs and PS. And
> this applies
> even when each consists of one line or one paragraph, hence
> no LS or PS
> in either file. Conclusion: both LS and PS must be added in ANY
> concatenation. Way to avoid this absurd conclusion: redefine
> LS and PS
> as line and paragraph terminators, to be used at end of file
> when (as is
> normal) this corresponds to a line or paragraph end.

No, and no.

The first and last lines in a text file may well be partial. If one
wants
a PS or LS in-between when concatenating them (assuming they are
of the same encoding), the LS or PS must be explicitly concatenated in.

(The result of reading, line-by-line, first file A then file B is not
always
the same as reading, line-by-line, the concatenation of files A and B.
I.e. readline does not distribute over concatenation, if you like that
kind
of formulation. Maybe you would like it to, but it doesn't, never has.)

        /kent k





This archive was generated by hypermail 2.1.5 : Thu Jan 18 2007 - 15:54:24 CST