[racket] Scribble and Contracts

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Mon Aug 1 06:14:57 EDT 2011

Thanks for the report! I've pushed a repair to the Racket git repo.

The problem was a mismatch between `make-base-eval' and
`make-base-eval-factory'. If you use `make-base-eval-factory' within
DrRacket (or some other context where `racket/gui/base' is loaded),
then the factory couldn't attach modules from an internal namespace to
the new evaluators that it creates.

At Sun, 31 Jul 2011 18:36:49 -0500, Patrick King wrote:
> While trying to scribble some documentation, I came across what seems to be
> a bug involving contracts and scribble's interaction form.
> 
> my-module.scrbl:
> 
> #lang scribble/manual
> @(require scribble/eval)
> 
> When I introduce contracts into "my-module.rkt", the following lines...
> 
> @(define my-eval (make-eval-factory (list "my-module.rkt")))
> 
> @(interaction #:eval (my-eval)
>               (my-thunk))
> 
> ... produces the error message:
> 
> namespace-attach-module: a different module with the same name is already in
> the destination namespace, for name: "C:\Program
> Files\Racket\collects\racket\contract.rkt"
> 
> my-module.rkt:
> 
> #lang racket/base
> (require racket/contract)
> (provide/contract [my-thunk (-> void?)])
> (define (my-thunk)  (display (format "Hi there, Racket fans!~n")))
> 
> If I do not use contracts in my-module.rkt, then the scribbling works fine.
> If I do, then evaluating (my-eval) generates the error.
> 
> What up?
> _________________________________________________
>   For list-related administrative tasks:
>   http://lists.racket-lang.org/listinfo/users


Posted on the users mailing list.