<div dir="ltr"><div><div>The module names "." and ".." are relative. There's no way for dynamic-require to use them unambiguously -- they have to be resolved at compile time. In this case, you need to either use a module path for the enclosing module yourself, or move the resolution to compile-time using quote-module-path:<br>
<br>#lang racket<br><br>(module m racket<br> (define x 123)<br> (provide x))<br><br>(require syntax/location)<br>(define path-to-m<br> (quote-module-path m))<br><br></div>Then at the REPL:<br><br></div>> (dynamic-require path-to-m 'x)<br>
123<br></div><div class="gmail_extra"><br clear="all"><div>Carl Eastlund</div>
<br><br><div class="gmail_quote">On Wed, May 29, 2013 at 5:19 AM, Tobias Hammer <span dir="ltr"><<a href="mailto:tobias.hammer@dlr.de" target="_blank">tobias.hammer@dlr.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
any idea why this is not working?<br>
<br>
#lang racket<br>
<br>
(module m racket<br>
(define x 123)<br>
(provide x))<br>
<br>
(dynamic-require '(submod "." m) 'x)<br>
;> standard-module-name-resolver: no base path for relative submodule path: (submod "." m)<br>
<br>
; OR<br>
<br>
(dynamic-require ''m 'x)<br>
;> dynamic-require: unknown module<br>
; module name: #<resolved-module-path:'m><br>
<br>
<br>
The equivalent require statements work as expected.<br>
Strangely exactly these cases are checked in test/racket/submodule.rktl<br>
(I suppose tests are kind of eval'd as my example runs with #lang racket/load)<span class="HOEnZb"><font color="#888888"><br>
<br>
Tobias<br>
<br>
<br>
-- <br>
------------------------------<u></u>---------------------------<br>
Tobias Hammer<br>
DLR / Robotics and Mechatronics Center (RMC)<br>
Muenchner Str. 20, D-82234 Wessling<br>
Tel.: 08153/28-1487<br>
Mail: <a href="mailto:tobias.hammer@dlr.de" target="_blank">tobias.hammer@dlr.de</a><br>
____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/<u></u>users</a><br>
<br>
</font></span></blockquote></div><br></div>