[racket] Module Availability

From: Sam Tobin-Hochstadt (samth at ccs.neu.edu)
Date: Fri Feb 8 12:35:06 EST 2013

On Fri, Feb 8, 2013 at 12:26 PM, Eric Dobson <eric.n.dobson at gmail.com> wrote:
> I'm trying to understand why TR requires a module that it doesn't actually
> use in the file that requires it.
>
> The requirement is unstable/contract in typed-racket/type-racket.rkt.
> Without it tests/typed-racket/succeed/succed-cnt.rkt fails. But when I try
> to reduce the test case to not use TR, I cannot replicate it.

This require is there so that the residual program is correct.  The
basic issue is that Typed Racket dynamically loads large parts of its
implementation, some of which is used to produce the residual code in
the expansion of a TR module (such as contracts, which can use
`unstable/contract`).  However, the resulting program must contain a
dependency on `unstable/contract`, otherwise Racket can't figure out
how to evaluate the reference. Therefore, the part of TR that is *not*
dynamically loaded needs to declare a static dependency on
`unstable/contract`.

Sam

Posted on the users mailing list.