(defun add-ten (n)
(+ n 10)
)
(let
(
(a 10) ;; a is initialized to 10
b ;; b has no initial value
)
... code involving a and b ...
)
(let*
(
(a 10) ;; a is initialized to 10
(b (+ a 1)) ;; b is initialized to 11
)
... code involving a and b ...
)
1. Open Common Lisp in one window.
2. Open your favorite editor in another window.
Suppose you are working on a file called
lisp.l.
3. Make code additions/modifications to lisp.l.
Save the changes.
4. At the lisp prompt, type (load "lisp.l").
5. Test the functions you wrote. If
you notice any errors, go to step 3.
6. At the lisp prompt, type (compile-file "lisp.l")
to compile your file. If there are any errors
or warnings, go to step 3 and fix them.
7. At the lisp prompt, type (load "lisp"). This
will load the compiled version of the file
(called lisp.fas) into the Common Lisp environment.
The compiled version should run several times faster.
;; ===================================
;; John Paxton
;; CS 436
;; September 3, 2004
;; -----------------------------------
;; Brief overview of this file's contents.
;; ===================================
;; -----------------------------------
;; KEEP-ENDS
;; -----------------------------------
;; Return a list of the first and last
;; top level items.
;; -----------------------------------
;; PARAMETERS
;; alist: an arbitrary list
;; -----------------------------------
(defun keep-ends ( alist )
(cons (first alist) (last alist))
)