Subject: bug#44155: Print integers as characters

From: Juri Linkov <[email-masked]>
Date: Mon, 02 Nov 2020 23:36:46 +0200

> 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.

> Since your original motivation was to print characters in pretty-printed
> nested Lisp expressions, perhaps we should just define
> print-integers-as-characters as a Boolean and skip the radix for the time
> being? We could add a print radix control later on if desired. (That would
> save us the hassle to deal with bignums, for that matter.)

This was my intention - to start with something simple that does only
what was needed (to print integers as characters), then extend it later
when such a need arises as printing hex numbers.  I added hex numbers only
as a proof that the variable integer-output-format is extensible enough
to support more formats in the future.

But as you point out, this is achievable by adding another variable like
print-integer-radix.

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