Thanks for the example! I did not guess correctly about your mixture of
embedded modules and `dynamic-require`.
The short answer is that you should either embed modules or reference
them through an external paths like "/Applications/Racket
v7.7/collects", but not both. Otherwise, the two worlds collide in
confusing ways, in this case along the lines Sam suggested.
Longer answer: When you embed a module, it pulls along a copy of
anything that module depends on. Your "test.rkt" pulls along
`racket/base`, which pulls along `racket/private/promise`, which
defines `force` and the promise datatype. But it doesn't
`racket/promise`, which defines `delay/sync`, and that leads to a
mismatch.
Very long answer: When `server` starts, there are two possible
`racket/private/promise`s available: the emebded copy and the one in
"/Applications/Racket v7.7/collects". As an artifact of the way that
`racket/promise` references `racket/private/promise`, the
`racket/promise` in "/Applications/Racket v7.7/collects" will always
refer to the `racket/private/promise` there. And so `delay/sync` as
used in `setup/private/dirs` will refer to the promise datatype there.
But the `force` used in `setup/private/dirs` goes through `racket/base`
and ends up referring the the embedded `racket/private/promise`, which
has its own promise datatype; since `force` doesn't recognize the
result of `delay/sync` as a promise, it doesn't force the (othe rkind
of) promise, and it instead just returns it. Finally, `planet/config`
is unhappy to get back a promise, because it expects a path.
If you expect a full "collects" directory and more to be around at run
time, then there's no reason to embed code, and just use
racket_dynamic_require(Sstring("test.rkt"), Sfalse);
to load the module. But if you want to embed everything, then avoid
`dynamic-require` or use `++lib` or `define-module-path-index` to carry
along the dynamically required modules.
Matthew
>
https://groups.google.com/d/msgid/racket-users/CAM-xLPoKbgtUGTFoRSvK0D2M%2BX_EE
> 38z0bwuW-p3MptyWHkCnw%
40mail.gmail.com.