Fwd: SRFI 270 Peter McGoron 06 May 2026 00:24 UTC
Forwarded conversation with Sergei Egorov.

______________________________________________________________

Yes, please do. I would do it myself, but then the attachment would be lost.

-S

On Tuesday, May 5, 2026 8:07:20 PM (-04:00), Peter McGoron wrote:

 > > Haven't you thought about a portable 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? It is easy just to scan for #\p in case of string->number, and
check the number type and radix for number->string.
 > > I haven't, but that's a good idea. I will put that on the to-do list.
 > > > I have played with this idea last year and have some portable
R7RS code that depends only on (srfi 143) and (srfi 144) for
fixnum/flonum manipulations. The code is attached, in case you are
interested.
 > > Thank you! I will definitely have a look. (The sample
implementation was going to be in Chez 10, simply because I have more
experience with modifying its internals. I will take a look at
implementing them portably using the SRFIs, since there are more flonum
operations in them.)
 > > > By the way, it is as easy to print flonums in radices 2 and 8,
supporting both 'e' format (where the exponent is based on and printed
in the same base as the mantissa), and 'p' format (where exponent is a
power of 2 printed in decimal) -- the code is the same.
 > > I will note that as a possible extension.
 > > ____________________________________________________
 > > Would you mind if I forwarded this reply and this email to the ML?
 > > -- Peter McGoron
 >

-------- Forwarded Message --------
Subject: Re: SRFI 270
Date: Tue, 05 May 2026 22:23:46 +0000
From: Sergei Egorov <xxxxxx@acm.org>
To: Peter McGoron <xxxxxx@mcgoron.com>

Hi Peter,

The idea is long overdue, thank you for proposing this.

Haven't you thought about a portable 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? It is easy just to scan for #\p in case of string->number, and
check the number type and radix for number->string.

I have played with this idea last year and have some portable R7RS code
that depends only on (srfi 143) and (srfi 144) for fixnum/flonum
manipulations. The code is attached, in case you are interested. By the
way, it is as easy to print flonums in radices 2 and 8, supporting both
'e' format (where the exponent is based on and printed in the same base
as the mantissa), and 'p' format (where exponent is a power of 2 printed
in decimal) -- the code is the same.

Best regards,
--Sergei