title: Auto-load dependent files in REPL
body: <p>I'm fairly new to Common Lisp, coming from Clojure, and am used to something like this:</p>
  
  <pre><code>(ns x.core
    (:require [x.util :as u]))
  </code></pre>
  
  <p>when I start a REPL and evaluate that file, <code>x.util</code> is automatically compiled and available to me in <code>x.core</code>.</p>
  
  <p>In Common Lisp I'm trying to do something similar. In <code>main.lisp</code>:</p>
  
  <pre><code>(defpackage x.main
    (:use :x.util))
  
  (in-package :x.main)
  
  (comment
   (load "util.lisp"))
  </code></pre>
  
  <p>and in <code>util.lisp</code>:</p>
  
  <pre><code>(defpackage x.util
    (:use :common-lisp)
    (:export :foo))
  
  (in-package :cl-blog.util)
  
  (defun foo () 3)
  </code></pre>
  
  <p>the only way I know to have access to <code>foo</code> from <code>util</code> in <code>main</code> is to evaluate the form inside the <code>comment</code> macro (which I define similar to Clojure's comment, to ignore its body).</p>
  
  <p>I have also tried this <code>x.asd</code> file:</p>
  
  <pre><code>(defsystem "x"
    :version "0.1.0"
    :author ""
    :license ""
    :components ((:module "src"
                          :components
                          ((:file "util")
                           (:file "main" :depends-on ("util")))))
    :description ""
    :in-order-to ((test-op (test-op "x/tests"))))
  </code></pre>
  
  <p>but that doesn't seem to help me with this problem.</p>
  
  <p>Is there a simpler and more standard way to automatically load (or re-compile) <code>util.lisp</code> when I compile <code>main.lisp</code> in the REPL? What's the standard workflow for working with multiple files in the REPL?</p>