Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>No, you do not enter functions on the REPL.</p> <p>You edit your source files, just as usual. The Lisp advantage is that you have the system running in the background at the same time, so you can compile individual functions from your source file and put them into the running system, or even replace them there.</p> <p>If you use Slime, you press <code>C-c C-c</code> in your source file to compile and load the function at point. You can then switch to the REPL to test and explore, but anything you want to persist as source, you put into your source files.</p> <p>Tutorials usually start by typing things on the REPL, because there is not much you need to set up for this, but serious development integrates the running system and source file management.</p> <hr> <p>Just to illustrate, my usual workflow (I am using Common Lisp, but Clojure is similar) is like this:</p> <ul> <li>Start Emacs</li> <li><code>M-x slime</code> to start Slime, the Lisp system, and connect the two via Swank</li> <li><code>,</code> (command) <code>load-system</code> <code>foo</code> to load the current project (compiling only if necessary) into the image</li> <li><code>C-x b</code> switch to a source buffer</li> <li><code>C-c ~</code> make the source directory the current directory and the source package the current package of the REPL</li> </ul> <p>Now, I'm set up with my system running in the background. Working is then:</p> <ul> <li>change or add a function or class definition</li> <li><code>C-c C-c</code> to compile and load it into the image</li> <li>switch to REPL, test</li> <li>debug</li> </ul> <p>There are no significant compilation pauses, because I never compile the whole thing at once, just individual definitions.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload