REPL - loading a file

Discussion of Common Lisp

REPL - loading a file

Postby Bdunbar » Mon Dec 05, 2011 9:59 am

Is there a way to load code from a file in REPL?

I am new to LISP, have not programmed for a living in a long time.

I am working my way through 'Land of LISP'. Typed the code for the text game engine from Chapter 5. My computer crashed - the typing was gone like it never existed.

Now, it's easy enough to bang out the code in emacs, copy/paste it in. But that seems a little awkward.

Is it best to exec long chunks of code from emacs? Or is there a way to load a file in REPL?

I am new at this: feel free to hit me with a clue-bat.
Posts: 1
Joined: Mon Dec 05, 2011 9:47 am

Re: REPL - loading a file

Postby Ramarren » Mon Dec 05, 2011 11:50 am

You can load a file from REPL using LOAD function. This also works anywhere, although directly loading files is fairly rare, since for programmatic uses you would use a system definition facility.

The typical way to develop Common Lisp code with Emacs is to use slime (which is best installed using Quicklisp). Slime includes commands for compiling and loading a file associated with a buffer, or evaluating single function definitions Practical Common Lisp describes some of that workflow in early chapters.
Posts: 613
Joined: Sun Jun 29, 2008 4:02 am
Location: Warsaw, Poland

Return to Common Lisp

Who is online

Users browsing this forum: Bing [Bot] and 7 guests