[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#24812: 25.1; Missing (binary) radix format directive
From: |
Alex |
Subject: |
bug#24812: 25.1; Missing (binary) radix format directive |
Date: |
Sat, 29 Oct 2016 13:34:02 -0600 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) |
Alex <agrambot@gmail.com> 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?