<div dir="ltr">Thats what I thought it was, but I cannot replicate with the following program.<div><br></div><div style>secret.rkt</div><div style><div>#lang racket/base</div><div>(provide (all-defined-out))</div><div>(define secret 1)</div>
<div><br></div></div><div style>secret-stx.rkt:</div><div style><div>#lang racket/base</div><div><br></div><div>(require (for-template "secret.rkt"))</div><div>(provide use-secret)</div><div><br></div><div>(define (use-secret) #'secret)</div>
<div><br></div><div style>secret-user.rkt</div><div style><div>#lang racket/base</div><div>(require (for-syntax racket/base))</div><div><br></div><div>(define-syntax (go stx)</div><div> (define use-secret (dynamic-require "secret-stx.rkt" 'use-secret))</div>
<div> (use-secret))</div><div><br></div><div>(go)</div><div><br></div><div style>The resulting program from compiling secret-user shouldn't have any dependency on secret, yet it works.</div><div><br></div></div></div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Feb 8, 2013 at 9:35 AM, Sam Tobin-Hochstadt <span dir="ltr"><<a href="mailto:samth@ccs.neu.edu" target="_blank">samth@ccs.neu.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Fri, Feb 8, 2013 at 12:26 PM, Eric Dobson <<a href="mailto:eric.n.dobson@gmail.com">eric.n.dobson@gmail.com</a>> wrote:<br>
> I'm trying to understand why TR requires a module that it doesn't actually<br>
> use in the file that requires it.<br>
><br>
> The requirement is unstable/contract in typed-racket/type-racket.rkt.<br>
> Without it tests/typed-racket/succeed/succed-cnt.rkt fails. But when I try<br>
> to reduce the test case to not use TR, I cannot replicate it.<br>
<br>
</div>This require is there so that the residual program is correct. The<br>
basic issue is that Typed Racket dynamically loads large parts of its<br>
implementation, some of which is used to produce the residual code in<br>
the expansion of a TR module (such as contracts, which can use<br>
`unstable/contract`). However, the resulting program must contain a<br>
dependency on `unstable/contract`, otherwise Racket can't figure out<br>
how to evaluate the reference. Therefore, the part of TR that is *not*<br>
dynamically loaded needs to declare a static dependency on<br>
`unstable/contract`.<br>
<span class="HOEnZb"><font color="#888888"><br>
Sam<br>
</font></span></blockquote></div><br></div>