8.12 Using Lisp-specific commands

8.12.1 Evaluating code

When you are editing Lisp code, you may want to evaluate part or all of the buffer in order to test the code. The easiest way to do this is via menu commands, although there are keyboard commands which allow you to evaluate Lisp in the editor as well.

There are three menu commands which allow you to evaluate Lisp in the current buffer.

Choose Buffers > Evaluate to evaluate all the code in the current buffer. If you are in the buffers view, then this command evaluates the code in all the selected buffers.

Choose Expression > Evaluate Region to evaluate the Lisp code in the current region. You must make sure you have marked a region before choosing this command; see Section 8.10.1 on page 100. Whether you use the mouse or keyboard commands to mark a region does not matter. If you have a few Lisp forms that you want to evaluate, but do not want to evaluate the whole buffer, you should use this command.

Choose Definitions > Evaluate to evaluate the definition in which the cursor currently lies. This is a little like evaluating the marked region, except that only the current definition is evaluated, whereas working with a marked region lets you evaluate several. This command is useful if you have a single function in the current buffer which you want to test without taking the time to evaluate the whole buffer or mark a region.

In the definitions or changed definitions views, this command evaluates the code for all the selected definitions, allowing you to evaluate code for a number of physically unrelated definitions with one command.

To load the code for any file into the environment (even if it is a file not currently loaded into the editor), choose File > Load. You are prompted for a file name in the echo area.


Common LispWorks User Guide, Liquid Common Lisp Version 5.0 - 18 OCT 1996

Generated with Harlequin WebMaker