Call me pedantic, but....

>From "The C Programming Language", Second Edition, by Brian W. Kernighan and Dennis M. Ritchie (the architects of C), page 193, which explicitly lists all allowable escape sequences. This defines them as follows:

    newline           NL (LF)   \n
    horizontal tab    HT        \t
    vertical tab      VT        \v
    backspace         BS        \b
    carriage return   CR        \r
    formfeed          FF        \f
    audible alert     BEL       \a
    backslash         \         \\
    question mark     ?         \?
    single quote      '         \'
    double quote      "         \"
    octal number      ooo       \ooo
    hex number        hh        \xhh

The second column is clearly a list of ASCII characters, and the first seven items are clearly a list of ASCII character names. The mapping for \n is explicitly "NL (LF)". My interpretation of this is that this can only refer to the ASCII control character LF, since that is what is explicitly named. (Yes, it's in brackets, but the accompanying text supplies no addition meaning to or interpretation of those brackets). This is axiomatically *THE* definition. Period. Everything else is merely quoting, rephrasing or reinterpretting this original.

I would be more than grateful if someone could point me in the direction of a DEFINITVE specification which claims this is not the case, that the interpretion of "\n" as anything other than LF may be considered conformant behaviour. (Usage does not define conformace to a standard). I will then be happy to modify my claim.

Of course, I'm not suggesting that violating this spec is wrong, merely that violating this spec is violating this spec.
Jill


> -----Original Message-----
> From: John Cowan [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 20, 2003 6:32 PM
> To: Jill Ramonsky
> Cc: [EMAIL PROTECTED]
> Subject: Re: Line Separator and Paragraph Separator
>
> > Strictly speaking, BY DEFINITION (from
> the C and C++
> > specs), "\n" is supposed to mean LF, and nothing else, 
>
> It means any one character that serves a new-linish function,
> which can
> be LF or CR or NEL, for example.  On EBCDIC-based systems, the native
> C compiler interprets \n as 0x25, which is NEL.

Reply via email to