[racket] Help: Scribble does not see readtable extensions when loading a module
Hi everyone,
I have developed a racket module that implements a new
language. In this module I have readtable re-definition like this:
------------mymodule.rkt---------------------
(module mymodule
(require racket/base)
...
; new readtable with extensions to support the reading of a new
; data structure: "mset" is a tuple of elements, like < 1, 2, 3 >
(define mset-readtable
(make-readtable #f #\< 'terminating-macro parse-open-mset ))
; change the reader to support my new data structure "mset"
(current-readtable mset-readtable)
...
)
----------------------------------------------------
Now I am trying to write documentation for this module with scribble.
When I use the @interaction in the followign way:
------------mymodule.scrbl---------------------
#lang scribble/manual
@(require scribble/eval)
...
@interaction[
(require mymodule)
(make-mset #(1 2 3 4))
(define t2 < 1, 2, 3, 4 >)
]
...
-------------------------------------------------------
I got this in the produced documetation web page:
--------------------------------------------------------
> (require mymodule)
> (make-mset #(1 2 3 4))
<1, 2, 3, 4>
> (define t2 < 1,2,3,4 >)
eval:3:0: define: bad syntax (multiple expressions after
identifier) in: (define t2 < 1 (unquote 2) (unquote 3)
(unquote 4) >)
--------------------------------------------------------
"make-mset" is my data structure constructor function, and it works
(you see the printout on the 3rd line),
but the same constructor should be called by the reader when
processing the "< 1, 2, 3, 4 >" input.
So my conclusion is that, for some reasons, the scribble
reader have not set my readtable extensions.
Does anyone know what is wrong?
Maurizio Giordano
PS: I also tried using @eval[...]
with a sandbox evalutator defined by me with
the "required" module loaded into it... but it gives
me the same result.