[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#44155: Print integers as characters

From: Mattias Engdegård
Subject: bug#44155: Print integers as characters
Date: Tue, 3 Nov 2020 00:03:31 +0100

2 nov. 2020 kl. 22.36 skrev Juri Linkov <juri@linkov.net>:
>> Thus we would have 10 -> ?\n, 13 -> ?\r, 127 -> ?\d, 65 -> ?A,
>> 255 -> ?ÿ, but 31 -> 31, 129 -> 129, 4194303 -> 4194303.
> Hopefully, printing some characters as numbers will fix
> the currently broken test.

It does! Here is a proposed patch. We could add a separate radix control later 
if you like.

One detail that I'm undecided about is whether to remove the more obscure 
control escapes \f, \a, \v, \e and \d, on the grounds that they are less likely 
to be used as actual characters and that users may prefer to see them as 
numbers instead. C, and most languages inheriting them from C, lack \e or \d; 
\f and \a are rare today, and \v is an anachronism.

> PS: I notices inconsistency in these names: "integer" in print-integer-radix
> is singular, but "integers" in print-integers-as-characters is plural.

Actually, 'integer' in 'integer radix' plays the part of adjective!

Attachment: 0001-Reduce-integer-output-format-to-print-integers-as-ch.patch
Description: Binary data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]