From: Brian Inglis <Brian.Inglis@Shaw.ca>
To: "G. Branden Robinson" <g.branden.robinson@gmail.com>
Cc: Alejandro Colomar <alx.manpages@gmail.com>,
Linux Man Pages <linux-man@vger.kernel.org>,
Tom Schwindl <schwindl@posteo.de>
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 16:32:31 -0700 [thread overview]
Message-ID: <877dd973-09e8-248e-2d7b-e098232b165e@Shaw.ca> (raw)
In-Reply-To: <20230218190354.supiu6teaby5el4l@illithid>
On 2023-02-18 12:03, G. Branden Robinson wrote:
> 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.
It is sad that the documentation tools, other than man, were not made freely and
widely available, so that the attitudes of many of the original developers
towards providing documentation, propagated alongside the system, language,
tools, and idioms.
We have the deliberations of IEC/ISO JTC1/SC22/WG21 C++ to thank for the
decision a decade ago, as well as the earlier addition of user defined type
constants, and other features, imposing restrictions on the preprocessor token
parser capabilities, and the strong desires of the WG14 C and WG21 C++
committees to keep as many base features in the languages as possible in sync.
Papers on digit separators:
https://open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3499.html
https://open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3661.html
https://open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3781.pdf
which C took up only in 2020-2021:
https://open-std.org/JTC1/SC22/WG14/www/docs/n2606.pdf
https://open-std.org/JTC1/SC22/WG14/www/docs/n2626.pdf
--
Take care. Thanks, Brian Inglis Calgary, Alberta, Canada
La perfection est atteinte Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer but when there is no more to cut
-- Antoine de Saint-Exupéry
next prev parent reply other threads:[~2023-02-18 23:32 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
2023-02-18 23:32 ` Brian Inglis [this message]
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=877dd973-09e8-248e-2d7b-e098232b165e@Shaw.ca \
--to=brian.inglis@shaw.ca \
--cc=alx.manpages@gmail.com \
--cc=g.branden.robinson@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