Lisp Files
Loading Lisp Files
You can enter Lisp expressions and Lisp functions at the command prompt. You can also load commands and functions from Lisp files.
A file containing Lisp code must be stored in an ASCII text file. The commonly used file extension is .lsp. However, you can use any file extension.
Use the load function to load a Lisp file.
Note: An extension other than ".lsp" needs to be passed to the load function.
Examples
: (load "test")
: (load "my.lsp")
Defining Functions and Commands
Normally a Lisp file contains one or more function definitions.
To define a function, use the defun function, which allows you to create your own functions and your own commands.
Example
(defun C:XYZ ()
(princ "My new command 'XYZ'!")
[...]
(princ)
)
Comments in Lisp Files
A semicolon (;) in a program's line indicates that the following text part to the line end is interpreted as a comment. This text part is not evaluated.
The text string ;| starts a multi-line comment. The following text lines are ignored up to the closing string |; that terminates a comment.