title: Syntax of require in the ClojureScript REPL
body: <p>This is certainly trivial, but I could not find it anywhere. I am trying to start fiddling with ClojureScript. I was able to get to a ClojureScript REPL with <a href="http://clojurescriptone.com/" rel="noreferrer">ClojureScript One</a>.</p>
  
  <p>I can connect with a browser and execute some simple DOM queries and manipulations there. Now I would like to start saving some useful functions into modules and load them as needed. This is where I get stuck.</p>
  
  <p>If I try something like</p>
  
  <pre><code>(require 'project.dom)
  </code></pre>
  
  <p>I get the exception <code>FileNotFoundException Could not locate project/dom__init.class or project/dom.clj on classpath</code>. I indeed have only <code>project/dom.cljs</code>, as I saw all ClojureScript files in the example use this extension.</p>
  
  <p>If I try to rename it to <code>project.clj</code>, I get a complaint about the missing namespace <code>js</code>. Of course I use that namespace quite a lot in the module.</p>
  
  <blockquote>
    <p>What is the proper way to write a simple ClojureScript file that can work with the browser, and load it from the REPL? Anything that will make able to run this simple example will do:</p>
  </blockquote>
  
  <pre><code>(ns ^{:doc "A module for selecting elements from the DOM."}
    project.dom)
  
  (defn get
    [selector]
    (.querySelectorAll js/document selector))
  </code></pre>