Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<blockquote> <p>-I get the REPL, but don't quite get how I can use it effectively. When I need to change a function I have to retype the defun and make changes (tedious and error prone). How can I do this better?</p> <p>-How do I get from entering code at the REPL to actually having a program? I'm used to the C model where you have code files that you can review, edit and recompile. I know lisp has something similar (via the load function), but how does one get a function I just defined and tested into a file to be saved? I'm hoping there's a better method than my current select+copy+paste.</p> </blockquote> <p>Load SLIME. Enter code in your <code>.lisp</code> file, and then run <code>slime-eval-buffer</code> to load all your code into Lisp. Then, for a specific function you are hacking on C-e, C-j to redefine it in your running Lisp.</p> <blockquote> <p>-How do you debug errors? Is there any ability to step into code like I would with other languages?</p> </blockquote> <p>Yes. (<code>trace 'my-function</code>) - or some variant on that - and when <code>my-function</code> is called, it will break into the debugger.</p> <blockquote> <p>-As long as the S-expression is valid, I don't get any errors when entering a (defun ...). It's not until I try to use it that I find out it's not valid. Is there any way to get errors sooner (i.e. compile the code)?</p> </blockquote> <p>To some degree, that is a characteristic of dynamic languages (Python, Perl, Ruby, Lisp, etc.). Try <a href="http://en.wikipedia.org/wiki/Steel_Bank_Common_Lisp" rel="nofollow">SBCL</a> for better error-checking.</p> <blockquote> <p>-Is there some IDE that would be more familiar to me or allow me to play with the language easier?</p> </blockquote> <p>Emacs is <em>the</em> free IDE for Lisp. Allegro has a free edition I believe; I've never tried it though..</p> <blockquote> <p>-Should I switch to learning Scheme instead?</p> </blockquote> <p>Nah, Scheme is not as pragmatic a language.</p>
 

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