guile-reader-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

confinement's read-hash-extend gives 'unknown number radix' for all tagg


From: Jelle Licht
Subject: confinement's read-hash-extend gives 'unknown number radix' for all tagged forms
Date: Wed, 16 Sep 2020 11:44:36 +0200

I'm trying to parse elisp S-expressions embedded in Guile.  Among other
things, 'backquotes', 'unquotes' and 'sharp quotes' are handled in very
distinct ways in the reader. For that very reason, I thought it useful
to allow tagging forms to be parsed as-if they were elisp.

version details:
   guile (GNU Guile) 3.0.2
   guile-reader 0.6.3 
    (both installed via guix)

Using the normal `read-hash-extend', this works perfectly fine (with the
usual drawbacks of `read-hash-extend'). I would prefer to have these
reader extensions enabled on a per-module basis instead.

The following works fine:
--8<---------------cut here---------------start------------->8---
(use-modules (language elisp parser))
(read-hash-extend #\e (lambda (_ port) (read-elisp port)))
(format #t "~S\n" #e(+ 1 1))
--8<---------------cut here---------------end--------------->8---
; 2

The following does not:
--8<---------------cut here---------------start------------->8---
(use-modules (system reader confinement)
             (language elisp parser))
(read-hash-extend #\e (lambda (_ port) (read-elisp port)))
(format #t "~S\n" #e(+ 1 1))
--8<---------------cut here---------------end--------------->8---
; ERROR: In procedure apply-smob/3:
; In procedure scm_read_number_and_radix: /tmp/confined.scm:3:20: unknown 
number radix

NB, this seems to happen regardless of the form I'm tagging with `#e'
here.

Am I missing some (obvious) detail that clearly makes guile-reader
unusable for my use-case?

Thanks,

Jelle Licht

   




reply via email to

[Prev in Thread] Current Thread [Next in Thread]