thank for your help Stephen, i tested the sole example of the doc and it does not seems to accept a reader,only a module as racket/base.
This is a bit the problem of Racket, i often encounter, the #lang language or #lang reader program that is so far from sexpr that it could not be used in any context. In fact #lang language could be replaced by (module program-name language... but there is no equivalent for #lang reader a-reader or #reader a-reader could not be represented as a sexpr module.
I can not find a solution and i do not think it is possible in Racket.
I don't have all the answers but I have some leads you might want to follow.
It looks like you're not supplying an evaluator to interaction (using its #:eval argument).
The docs say interaction works the same as examples (from scribble/example) with a few minor changes, so check the docs for examples.
The docs for examples say you can supply your own evaluator, defined using make-evaluator.
I recommend reading the docs for make-evaluator carefully. Yes they are complicated at first glance but if you want to be doing advanced things with eval'd code this is where the advanced functionality is described in detail.
In particular those docs say that if you supply code to the evaluator as a string or an input port, the code will be read using the function currently stored in the sandbox-reader parameter. If you can access the binding for whatever the equivalent of syntax-read is for your #lang, you can probably use it with this parameter.
yes i will take a look at that. I have sort of syntax-read of course in the code of SRFI-105, if i find a way to import that in a scribble document,why not?
for now i just use codeblock directives , in my scribble.
It is amazing i got the idea when i see that when compiling scribble pages to html the system was evauating some expression in codeblock as if the scribble document was code...
The docs don't always have examples of everything one might want to attempt. In such cases there's no choice but to buckle down and not scan for code to use but thoroughly understand the concepts involved. In this case I was able to cobble this together just by squinting at the docs and trying stuff in DrRacket. I already have an understanding of how to use parameters, which helped quite a bit.
Note that even though the code I give to interaction is in a non-s-expression syntax, interaction will always typeset it as an S-expression. Which makes sense because the REPL is always using S-expressions anyway. Here's the HTML rendered result of the above program:
I find a racket discourse post with the same problem that was talking of a solution using a third party library, i suppose this library exists because things are hard. I used scribble-code-example library.
this times , the library accepts the `#lang reader SRFI-105" and the result is:
about your solution, i still have dificulties, some hard points are you seem to use make-base-eval but i must write a special evaluator for infix, also i can not rely on the REPL using only sexpr because in my case i use curly infix expressions starting with { }.
Perheaps you can find a solution with your knowledge if i give you the things special to my case but otherwise i will use the third party lib:
in my case there a few points to specialize:
somewhere there should be #lang reader SRFI-105 or #reader SRFI-105 as Racket accept both forms
in the use by scribble of my SRFI-105 reader the sandbox-reader i suppose must be set to the one defined in my reader , which by convention for racket REPL is read-syntax but if it is a convention why should we specified it? here is my module definition of SRFI-105:
litteral-read-syntax are defined using curly-infix-read one does not have to know this internal definition.
As it is a convention i suppose that there is no need to specify it in code-examples, or perheaps the library sends the tokens to the reader and just get the result,i do not know.
Unless you have a solution according with this few specifications , i will use code-examples one as it is the only one that works for now.
Again, Joel, thank you for your help.
Sincere thanks
Damien