public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
From: "G. Branden Robinson" <g.branden.robinson@gmail.com>
To: Tom Schwindl <schwindl@posteo.de>
Cc: Alejandro Colomar <alx.manpages@gmail.com>,
	Brian Inglis <Brian.Inglis@Shaw.ca>,
	Linux Man Pages <linux-man@vger.kernel.org>
Subject: Re: [PATCH v3 5/6] man2/chmod.2: add C digit separators to clarify POSIX feature release dates and long numeric digit strings
Date: Sat, 18 Feb 2023 13:03:54 -0600	[thread overview]
Message-ID: <20230218190354.supiu6teaby5el4l@illithid> (raw)
In-Reply-To: <CQLWIYCOY3P2.3EHP3RAE6LJTD@morphine>

[-- Attachment #1: Type: text/plain, Size: 3865 bytes --]

Hi Tom,

At 2023-02-18T18:31:25+0000, Tom Schwindl wrote:
> > Do you expect C programmers to be more likely to copy and paste from
> > the man page source document or from the rendered page (probably in
> > a terminal window, but possibly from a PDF)?
> >
> 
> I expect them to copy & paste from the rendered page but I thought
> writing out "'" is a bit cumbersome so I refer to it as \[aq].

Ahh, that can be a bit confusing without clear context.  :D

> My "worry" with this was that new programmers could potentially
> execute a command like the following:
> 
>   $ cc -D_POSIX_C_SOURCE=1993'09L test.c
> 
> and wonder what they did wrong.

I see--that is a good point.  But I don't know that there is much the
man pages can do about that issue, apart from having a better intro(1)
page.  The scenario you imagine is an unfortunate consequence of the
grouping character WG14 selected.

New C programmers on *nix are going to have to develop some
sophistication with the POSIX shell language as well, and that will be
even more the case now--a cost of letting the Swiss win battles...

Mainly because Alex is reading, I will point out that Ada did this, and
several other aspects of numeric literals, right--40 years ago.

>> Numeric literals are all introduced by an initial digit. A
>> requirement that has long been recognized when printing numeric
>> tables is for a character to break up long sequences of digits: in
>> Ada, the underline character serves this purpose. In contrast to
>> identifiers, underlines in numeric literals do not alter the meaning,
>> so that 12_000 naturally has the same value as 12000.
>>
>> A simple sequence of digits is an integer literal written in decimal
>> notation. For other bases from 2 up to 16, the base is given first
>> and is followed by a sequence of digits enclosed by sharp characters
>> (#) or by colons (:), the colon being used as replacement character
>> for the sharp, but only when the sharp is not available. The enclosed
>> digits may include the letters A to F for bases greater than ten.
>> Thus, the conventional ways of expressing bit patterns in binary,
>> octal, or hexadecimal are provided.
>>
>> Real literals must contain a period, which represents the radix
>> point. They may be expressed in decimal notation or with other bases.
>> Finally, both integer and real literals may include the letter E
>> followed by an exponent.

http://archive.adaic.com/standards/83rat/html/ratl-02-01.html#2.1

But C programmers have long indulged in the sport of ignoring every
lesson any other programming language had to teach, whether through
careful design or blundering mistake.[1]  C'est la vie.

> But thinking about it a bit longer, copy & pasting from the rendered
> manpage might be the bigger issue.

This prospect was a major factor in my efforts to get groff's own man
pages much more fastidious in this respect, and to promulgate the usage
of appropriate special characters in man page sources, an initiative
that I'm not sure has yet taken flight, although Linux man-pages is
rapidly improving in this regard.  The real test is whether such careful
practice percolates elsewhere, where disinterest in (or outright
resentment of) writing documentation, in man(7), mdoc(7), or any other
form, is rampant.

Regards,
Branden

[1] Thompson discarded type checking and "//" comments from BCPL; the
    latter came back relatively painlessly (though only in C99, which
    Ritchie refused to endorse).  The former has been resurrected in
    fitful stages, and only where the suffering imposed by careless
    typing can be discerned as imposing engineering costs in defect
    resolution greater than in initial implementation by a factor of
    1,000 or more.

    https://www.bell-labs.com/usr/dmr/www/chist.html

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2023-02-18 19:04 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-15 20:15 [PATCH v3 0/6] man2/: use C digit separators, IEC, or ISO multiples to clarify long numeric digit strings Brian Inglis
2023-02-15 20:17 ` Brian Inglis
2023-02-15 20:17 ` [PATCH v3 1/6] man2/: use IEC " Brian Inglis
2023-02-15 21:05   ` Alejandro Colomar
2023-02-16 21:06   ` Stefan Puiu
2023-02-16 23:01     ` Alejandro Colomar
2023-02-16 23:40       ` Brian Inglis
2023-02-16 23:51         ` Alejandro Colomar
2023-02-17 14:05       ` Stefan Puiu
2023-02-19 21:10         ` Alejandro Colomar
2023-02-19 21:12           ` Alejandro Colomar
2023-02-20 14:29           ` Stefan Puiu
2023-02-20 15:35             ` Alex Colomar
2023-02-21 17:00               ` Rob Landley
2023-02-22  1:34                 ` Alex Colomar
2023-02-22 22:18                   ` Rob Landley
2023-02-24  1:05                     ` Alex Colomar
2023-02-16 21:40   ` Jakub Wilk
2023-02-15 20:17 ` [PATCH v3 2/6] man2/keyctl.2: use IEC or ISO multiples or add C digit separators " Brian Inglis
2023-02-15 21:06   ` Alejandro Colomar
2023-02-15 20:17 ` [PATCH v3 3/6] man2/: add C digit separators to clarify POSIX feature release dates Brian Inglis
2023-02-15 21:08   ` Alejandro Colomar
2023-02-16 21:11   ` Stefan Puiu
2023-02-16 23:04     ` Alejandro Colomar
2023-02-17 14:16       ` Stefan Puiu
2023-02-15 20:17 ` [PATCH v3 4/6] man2/select.2: add C digit separators to clarify POSIX feature release dates or use IEC or ISO multiples to clarify long numeric digit strings Brian Inglis
2023-02-15 21:09   ` Alejandro Colomar
2023-02-15 20:17 ` [PATCH v3 5/6] man2/chmod.2: add C digit separators to clarify POSIX feature release dates and " Brian Inglis
2023-02-15 21:10   ` Alejandro Colomar
2023-02-18 17:42     ` Tom Schwindl
2023-02-18 18:08       ` G. Branden Robinson
2023-02-18 18:31         ` Tom Schwindl
2023-02-18 19:03           ` G. Branden Robinson [this message]
2023-02-18 23:32             ` Brian Inglis
2023-02-19 11:50             ` ADA and base prefix for numbers Alejandro Colomar
2023-02-18 18:41       ` [PATCH v3 5/6] man2/chmod.2: add C digit separators to clarify POSIX feature release dates and long numeric digit strings Brian Inglis
2023-02-15 20:17 ` [PATCH v3 6/6] man2/: add C digit separators to clarify " Brian Inglis
2023-02-15 21:14   ` Alejandro Colomar
2023-02-15 22:51 ` [PATCH v3 0/6] man2/: use C digit separators, IEC, or ISO multiples " Brian Inglis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230218190354.supiu6teaby5el4l@illithid \
    --to=g.branden.robinson@gmail.com \
    --cc=Brian.Inglis@Shaw.ca \
    --cc=alx.manpages@gmail.com \
    --cc=linux-man@vger.kernel.org \
    --cc=schwindl@posteo.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox