Subject: Re: 25.1; Missing (binary) radix format directive

From: Alex <[email-masked]>
Date: Sat, 29 Oct 2016 13:34:02 -0600

Alex <[email-masked]> writes:

> Emacs' `format' has %o, %x, and %d, but it's missing both the ~r and ~b
> radix directives from Common Lisp's `format'.
>
> I can understand leaving out ~r, but I think ~b is worth adding to
> Emacs' `format'.
>
> CL example:
> (format nil "~b" 5) => "101"
>
> Requested:
> (format "%b" 5) => "101"

I noticed that while string_to_number supports an arbitrary base,
number_to_string doesn't.

If number_to_string was symmetric in this aspect, then ~b and ~r should
be straightforward to implement, right?