title: How to (re)load files in Racket (X)REPL?
body: <p>Suppose I have a file like</p>
  
  <pre><code>#lang racket/base
  (define (hello) (print "Hello"))
  ... more definitions ...
  </code></pre>
  
  <p>and I would like to load the definitions in the file to interactively work with them in the (X)REPL. How do I do that?</p>
  
  <p>If I start the (X)REPL and <code>(load "/tmp/hello.rkt")</code>, then the <code>hello</code> function is not made available to me:</p>
  
  <pre><code>-&gt; (hello)
  ; hello: undefined;
  </code></pre>
  
  <p>If I <code>(require (file "/tmp/hello.rkt"))</code>, the result is the same. Now I <em>can</em> <code>(enter! (file "/tmp/hello.rkt"))</code> and then <code>(hello)</code> works, but this seems rather ... unintuitive and beginner-unfriendly.</p>
  
  <p>Is this indeed the way this should be done and should I simply read up on modules and namespaces to easily browse and experiment with my code or is there a simpler way I'm overlooking?</p>
  
  <p>N.B. I found <a href="https://stackoverflow.com/questions/6380327/how-do-you-load-a-file-into-racket-via-command-line">How do you load a file into racket via command line?</a>, but that only explains how to <em>run</em> the file. Not how to load it in the REPL, so you can test/debug some specific definitions, then edit, reload, etc.</p>