[plt-scheme] [scribble] custom evaluator
You need to parameterize `sandbox-output' and `sandbox-error-output'
to 'string while callinh `make-evaluator'.
At Sat, 1 May 2010 13:17:01 -0400, Eric Tanter wrote:
> Hi again,
>
> I'm trying to use an evaluator for interactions that uses the plai language.
>
> I figured out how to create such an evaluator and use it, eg.:
> #lang scheme
> (require scheme/sandbox)
> (define plai-eval (make-evaluator 'plai '(define-type Bar (bar (x number?)))))
> (plai-eval '(let ((x 10))
> (bar x)))
> --> (bar 10)
>
> Now, in Scribble:
>
> #lang scribble/manual
> @(require scribble/eval)
> @(require scheme/sandbox)
> @(define plai-eval (make-evaluator 'plai '(define-type Bar (bar (x number?)))))
> @interaction[
> #:eval plai-eval
> (let ((x 10))
> (bar x))]
>
> string=?: expects type <string> as 2nd argument, given: #f; other arguments
> were: ""
>
> === context ===
> /Applications/_Extra/Devel/PLT Scheme v4.2.5/collects/scribble/eval.ss:83:6:
> loop
> /Applications/_Extra/Devel/PLT Scheme v4.2.5/collects/scribble/eval.ss:78:2:
> interleave
> /Users/etanter/Develop/Scheme/Scribble/test2.scrbl: [running body]
> /Applications/_Extra/Devel/PLT Scheme
> v4.2.5/collects/scheme/private/map.ss:18:11: map
> /Applications/_Extra/Devel/PLT Scheme v4.2.5/collects/scribble/run.ss:
> [running body]
> /Applications/_Extra/Devel/PLT Scheme
> v4.2.5/collects/scribble/tools/drscheme-buttons.ss:24:3
> /Applications/_Extra/Devel/PLT Scheme
> v4.2.5/collects/scheme/private/more-scheme.ss:158:2:
> call-with-break-parameterization
> /Applications/_Extra/Devel/PLT Scheme
> v4.2.5/collects/scheme/private/more-scheme.ss:274:2:
> call-with-exception-handler
>
> Any idea of what I am doing wrong?
>
> Thanks,
>
> -- Éric
>
>
> _________________________________________________
> For list-related administrative tasks:
> http://list.cs.brown.edu/mailman/listinfo/plt-scheme