Talk:newline

From Wiktionary, the free dictionary
Jump to navigation Jump to search

This entry has survived Wiktionary's verification process.

Please do not re-nominate for verification without comprehensive reasons for doing so.


Sense:

  • (computing) The C and C++ programming languages escaped character sequence represented as '\n'.

Tagged, not listed. (Verification of the etymology too? See comment at [1]) Cynewulf 16:20, 23 January 2007 (UTC)[reply]

This isn't obvious? Oh, drudge... DAVilla 17:08, 23 January 2007 (UTC)[reply]
Why didn't Connel just fix it, instead of tagging it? From his edit comment, he surely knows. ( \n is newline in a lot of languages and contexts ) He wasn't doubting it. Robert Ullmann 17:27, 23 January 2007 (UTC)[reply]
Laziness. I tagged it without listing, for a couple reasons: 1) I have been refocusing elsewhere. 2) I thought I was the only one these days checking for "tagged but not listed" entries. 3) It was so obviously wrong, someone else would certainly clean it up as soon as they ran across it. 4) I wanted to review this and similar entries a month or three from now. 5) I didn't feel like researching it, to find how just how far back the concept goes...perhaps the telegraph? I dunno...it seemed like the possibilities were endless. 6) Because the first person that saw it obviously would clean it up, I saw no point in wasting everyone's time discussing it at length.  :-)   --Connel MacKenzie 05:53, 24 January 2007 (UTC)[reply]
BTW, was I the only one here who thought of this when seeing this entry? --Connel MacKenzie 08:45, 24 January 2007 (UTC)[reply]
My understanding is that \n and similar escapes derive from C -- LISP's format uses ~%. "C-style" perhaps. Could be wrong of course. Cynewulf 17:43, 23 January 2007 (UTC)[reply]
Perhaps it's a question of whether the definition should be restricted to C/C++. It's easy enough to verify it for them, of course, but is there a separate, distinct definition to cover C derived languages vs. other languages? (BTW, here's some formatted quotes, not all of which illustrate sense two) --Jeffqyzt 21:47, 23 January 2007 (UTC)[reply]
  • 1959, Association for Computing Machinery, Communications of the ACM (ACM Digital Library) Page 599
    The ugly part is the quote marks on two adjacent lines that mean a newline character.
  • 1987, T. D. Brown, C for Basic Programmers Page 13
    The calculator program starts off by printing the string "O\n", that is, it prints a zero and then moves to a newline.
  • 2002, Laura Lemay, Rafe Colburn, Sams Teach Yourself Perl in 21 Days, Page 69
    Unlike in C, you don't have to loop through the output and watch every character to make sure it's a newline; Perl will keep track of that for you.
  • 2002, Allen B. Downey, Jeffrey Elkner and Chris Meyers, How to Think Like a Computer Scientist: Learning with Python
    It contains only a single statement, which outputs a newline character. (That's what happens when you use a print command without any arguments.)
  • 2006, Jeffrey E.F. Friedl, Mastering Regular Expressions Page 111
    The original Unix regex tools worked on a line-by-line basis, so the thought of matching a newline wasn't an issue until the advent of sed and lex.

The \n syntax seriously predates C and Unix; it goes back at least to MULTICS, from which C/Unix got it. (That was part of Connel's comment.) Robert Ullmann 23:15, 23 January 2007 (UTC)[reply]

RFV passed.RuakhTALK 22:13, 23 May 2007 (UTC)[reply]