[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: confinement's read-hash-extend gives 'unknown number radix' for all
Re: confinement's read-hash-extend gives 'unknown number radix' for all tagged forms
Thu, 22 Oct 2020 00:33:02 +0200
Ludovic Courtès <email@example.com> writes:
> It seems that the problem is that Guile-Reader’s ‘read-hash-extend’
> appends hash extensions, whereas Guile’s prepends them. See
> (set! sharp-specs
> ;; Append the module's hash extensions. Warning: no attempt is
> ;; made to avoid conflicts.
> (append (map (lambda (chr+proc)
> (make-token-reader (car chr+proc)
> (lambda (chr port read top)
> (apply (cdr chr+proc)
> (list chr port)))))
> (ensure-reader-hash-extensions module))
> Consequently, the default behavior for #e kicks in, and that invokes the
> “token reader” for numbers.
Exactly, I came to the same conclusion after your hints on IRC. Thanks
for looking into this.
> We could change the code above to prepend.
I think it makes sense if you want Guile-Reader’s ‘read-hash-extend’ to
be a drop-in replacement.
Is this a request for a patch from me, or simply asking about
my thoughts before you do what needs doing?