The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
* [TUHS] // comment in C++
@ 2017-02-09 21:14 Doug McIlroy
  2017-02-10 17:39 ` Steffen Nurpmeso
  0 siblings, 1 reply; 40+ messages in thread
From: Doug McIlroy @ 2017-02-09 21:14 UTC (permalink / raw)


With no offense intended, I can't help noting the irony of the
following paragraph appearing in a message in the company of
others that address Unix "bloat".

>'\cX'    A mechanism that allows usage of the non-printable
>          (ASCII and compatible) control codes 0 to 31: to cre-
>          ate the printable representation of a control code the
>          numeric value 64 is added, and the resulting ASCII
>          character set code point is then printed, e.g., BEL is
>          '7 + 64 = 71 = G'.  Whereas historically circumflex
>          notation has often been used for visualization pur-
>          poses of control codes, e.g., '^G', the reverse
>          solidus notation has been standardized: '\cG'.  Some
>          control codes also have standardized (ISO 10646, ISO
>          C) alias representations, as shown above (e.g., '\a',
>          '\n', '\t'): whenever such an alias exists S-nail will
>          use it for display purposes.  The control code NUL
>          ('\c@') ends argument processing without producing
>          further output.

Except for the ISO citations, this paragraph says the same
thing more succinctly.

'\cX'    represents a nonprintable character Y in terms of the
          printable character X whose binary code is obtained
          by adding 0x40 (decimal 64) to that for Y. (In some
          historical contexts, '^' plays the role of '\c'.)
          Alternative standard representations for certain
          nonprinting characters, e.g. '\a', '\n', '\t' above,
          are preferred by S-nail. '\c@' (NUL) serves as a
          string terminator regardless of following characters.

And this version, 1/3 the length of the original, tells all
one really needs to know.

'\cX'    represents a nonprintable character Y in terms of the
          printable character X whose binary code is obtained
          by adding 0x40 (decimal 64) to that for Y. '\c@'
          (NUL) serves as a string terminator regardless of
          following characters.

Doug]


^ permalink raw reply	[flat|nested] 40+ messages in thread
* [TUHS] // comment in C++
@ 2017-02-09 14:44 Noel Chiappa
  2017-02-09 16:51 ` Steffen Nurpmeso
  0 siblings, 1 reply; 40+ messages in thread
From: Noel Chiappa @ 2017-02-09 14:44 UTC (permalink / raw)


    > From: Michael Kjorling

    > That wouldn't have anything to do with how ^@ is a somewhat common
    > representation of 000, would it? .. I've always kind of wondered where
    > that notation came from.

Well, CTRL-<*> is usually just the <*> character with the high bits cleared.
So, to have a printing representation of NULL, you have two character choices
- SPACE, and '@'. Printing "^ " is not so hot, so "^@" is better.

Also, if you look at an ASCII table, usually people just take the @-_ column,
and use that, since every character in that column has a printing
representation. The ' '-? column is missing the ' ', and `-<DEL> is missing
the DEL. So if you just take a CTRL character and set the 0100 bit, and print
it as "^<char>", you get something readable.

(Note that CTRL-' ' _is_ usually used when one needs to _input_ a NUL
character.)

	Noel


^ permalink raw reply	[flat|nested] 40+ messages in thread
* [TUHS] // comment in C++
@ 2017-02-08 18:06 ron minnich
  2017-02-08 18:08 ` A. P. Garcia
                   ` (2 more replies)
  0 siblings, 3 replies; 40+ messages in thread
From: ron minnich @ 2017-02-08 18:06 UTC (permalink / raw)


I've always wondered if this was done in honor of JCL, as sort of a riff on
the dd command. Anyone know?

ron
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20170208/2b97e431/attachment.html>


^ permalink raw reply	[flat|nested] 40+ messages in thread

end of thread, other threads:[~2017-02-10 17:39 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <mailman.204.1486594285.3779.tuhs@minnie.tuhs.org>
2017-02-09  0:03 ` [TUHS] // comment in C++ Paul McJones
2017-02-09  2:28   ` Marc Rochkind
2017-02-09 13:11   ` Tony Finch
2017-02-09 21:14 Doug McIlroy
2017-02-10 17:39 ` Steffen Nurpmeso
  -- strict thread matches above, loose matches on Subject: below --
2017-02-09 14:44 Noel Chiappa
2017-02-09 16:51 ` Steffen Nurpmeso
2017-02-09 19:36   ` Steffen Nurpmeso
2017-02-08 18:06 ron minnich
2017-02-08 18:08 ` A. P. Garcia
2017-02-08 18:17 ` arnold
2017-02-08 23:39   ` Steve Johnson
2017-02-08 23:52     ` Dave Horsfall
2017-02-09  2:11       ` Corey Lindsly
2017-02-09  2:46         ` Dave Horsfall
2017-02-09  2:53           ` Corey Lindsly
2017-02-09  4:38           ` Warner Losh
2017-02-09  2:47       ` Steve Nickolas
2017-02-09  4:55         ` Steve Johnson
2017-02-09 11:59           ` Michael Kjörling
2017-02-09 21:56             ` Dave Horsfall
2017-02-10  0:17               ` Dan Cross
2017-02-10  1:58                 ` Dave Horsfall
2017-02-10  2:46                   ` Nemo
2017-02-10  2:49                     ` Dave Horsfall
2017-02-10  9:30                   ` arnold
2017-02-10  9:19               ` arnold
2017-02-09 12:18           ` Brantley Coile
2017-02-09 13:31             ` Nick Downing
2017-02-08 22:45 ` Greg 'groggy' Lehey
2017-02-08 22:50   ` Ron Natalie
2017-02-08 23:22     ` Greg 'groggy' Lehey
2017-02-09 12:12     ` Michael Kjörling
2017-02-09 12:26       ` Lars Brinkhoff
2017-02-09 14:37         ` Random832
2017-02-09 14:49           ` Random832
2017-02-09 12:31       ` Paul Ruizendaal
2017-02-09 13:07         ` Steffen Nurpmeso
2017-02-08 22:51   ` ron minnich
2017-02-08 23:22     ` Greg 'groggy' Lehey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).