<div dir="ltr"><div>Yi,<br><br></div>Most #lang languages implicitly create a module from the contents of the file. #lang racket/load, on the other hand, runs the contents of the file as top-level terms outside of any module. The provide form is not legal at the top level, as it is meaningless -- there's no module to provide things from. You need to either switch back to #lang racket or remove the provide, depending on what you're trying to accomplish.<br>
</div><div class="gmail_extra"><br clear="all"><div>Carl Eastlund</div>
<br><br><div class="gmail_quote">On Sun, Aug 4, 2013 at 4:12 AM, Yi Dai <span dir="ltr"><<a href="mailto:plmday@gmail.com" target="_blank">plmday@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">Hi,</span><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">
<div>I have the following code in a file named `foo.rkt`:</div><div><br></div><div>```</div><div>#lang racket/load</div><div><br></div><div>(provide foo)</div><div><br></div><div>(define foo 'bar)</div><div>```</div>
<div>
<br></div><div>When trying to run the code, I got the following confusing error:</div><div><br></div><div>> `provide`: not at module level in: `(provide foo)`</div><div><br></div><div>What does this mean? Why `provide` is not at module level?</div>
<div>Use `#lang racket` instead does not pose this problem. I am</div></div><div style="font-family:arial,sans-serif;font-size:13px">confused. Any idea?</div><div style="font-family:arial,sans-serif;font-size:13px"><br>
</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Yours truly,</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">
Yi</div></div>
<br>____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
<br></blockquote></div><br></div>