<div>Dear list members,<br></div><div><br></div><div>Can someone explain the following behavior</div><div><br></div><div>Case 1 as follows works in the DrRacket Definitions window but doesn't work in the Interactions window</div>
<div>#lang racket</div><div>(module m racket<br> (provide color)<br> (define color "blue"))<br><br>(module n racket<br> (require (submod ".." m))<br> (printf "my favorite color is ~a\n" color))</div>
<div><br></div><div>Case 2 as follows works in the DrRacket Interactions window but doesn't work in the Definitions window</div><div>> (module m racket<br> (provide color)<br> (define color "blue"))<br>
<br>(module n racket<br> (require 'm)<br> (printf "my favorite color is ~a\n" color))<br>(require 'n)</div><div><br></div><div>I'm clear why in case 1 (submod ".." m) resolves to submodule m when the code is in the definitions window, but I'm not clear why it doesn't do so when the code is in the Interactions window. </div>
<div><br></div><div>I'm also not clear why case 2 works in the Interactions window. I.e. I'm not clear why in case 2 in the interactions window (require 'm), which according to the Racket Guide expands to (require (submod "." m) works and (require (submod ".." m) doesn't work for this case.</div>
<div><br></div><div>Also is there a way to have </div><div> #lang racket</div><div> (module m racket<br> (provide color)<br> (define color "blue"))</div><div><br></div><div>in the definitions window but the following in the interactions window<br>
</div><div><br></div><div> >(module n racket<br> (require SOME SUBMODULE PATH TO m)<br> (printf "my favorite color is ~a\n" color))<br> (require 'n) </div><div><br></div><div>and have it work.</div>
<div><br></div><div>Thanks,</div><div>Harry Spier</div><div><br></div>