feedback Jim Rees (04 May 2026 17:40 UTC)
Re: feedback Peter McGoron (05 May 2026 21:49 UTC)
(missing)
Re: SRFI 270 Peter McGoron (11 May 2026 17:08 UTC)
Re: SRFI 270 Sergei Egorov (11 May 2026 17:26 UTC)
Re: feedback John Cowan (05 May 2026 22:23 UTC)

Re: SRFI 270 Peter McGoron 11 May 2026 17:07 UTC

Hello,

Would you be OK with putting that code under the MIT license so I could
integrate it into the sample implementation? Then I can bundle an R7RS
version of `write-hexadecimal-float`, which currently only has an R6RS
implementation.

_________________________________________

 > Not for integration with the reader/printer, but extending
string->number and number->string, falling back to the original
implementations if radix is not 16?

After working on it a little bit:

Adding a string->number implementation is complicated because the hex
float syntax is for each ⟨real 16⟩: for instance,
#xxxxxx@1.921fb54442d18p0 must read as (approximately) 0.0+9.0i.
Implementing the whole syntax even for just radix 16 is pretty complicated.

Many extensions to number->string will print radix 16 numbers in a way
that is not described by the SRFI. `write-hexadecimal-float` can be used
to write to a string, but with a stricter output format. One could
implement a number->string like (modulo error checking)

     (define (number->string z radix)
       (if (and (= radix 16) (inexact? z))
           (call-with-string-output-port
             (lambda (port) (write-hexadecimal-float z port)))
           (rnrs:number->string z radix)))

-- Peter McGoron