Continuing my attempts to make a working meta-language, I'm now working on 
improving the documentation. I'd like to be able to use “interaction” from 
scribble/eval with a custom evaluator, but I'm having trouble getting a custom 
evaluator to work with my language.

I've tried using (make-module-evaluator "#lang curly-fn racket/base"), but that 
only enables the curly-fn reader for reading the initial program, not the 
additional input passed to the evaluator.

I have managed to do this sort of thing to get it working.

(parameterize ([sandbox-output 'string]
               [sandbox-error-output 'string]
               [sandbox-reader
                (λ (in)
                  (parameterize ([current-readtable (make-curly-fn-readtable)])
                    (reverse
                     (let loop ([acc null])
                       (define r (read-syntax in (current-input-port)))
                       (if (eof-object? r) acc (loop (cons r acc)))))))])
  (make-module-evaluator "#lang curly-fn racket/base"))

That works, but I'm wondering if there's a better way.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to