( cond ((= 1 1) 42) ) ( cond ((= 1 2) 42) (t 2112) ) (define factorial(n) ( cond ( (eq n 0) 1 ) ( t (* n (factorial (- n 1))) ) ) ) (define m91(x) ( cond ( (> x 100 ) (- x 10) ) (t (m91(m91(+ x 11))) ) ) ) (define append (n m) ( cond ( (null n) m ) ( t (cons (car n) (append (cdr n) m)) ) ) ) (set 'L1 '(h a l)) (set 'L2 '(9 0 0 0)) (append L1 L2) ----------------------------- A tiny CommonLISP program (tested in SBCL) ----------------------------- ;GetPos function (defun getPos(char string) (print (format nil "getPos() called with ~A and ~B." char string)) (position char string) ) ;Main function (defun main() (write-line "Welcome to the Encrypter... ") (set 'alpha (string "ABCDEFGHIJKLMNOPQRSTUVWXYZ")) (print alpha) (print (position #\A alpha)) (print (position #\B alpha)) (print (position #\Z alpha)) (print (getPos #\A alpha)) (print (getPos #\B alpha)) (print (getPos #\Z alpha)) (set 'pos-A (getPos #\A alpha)) (print pos-A) (set 'pos-B (getPos #\B alpha)) (print pos-B) (set 'pos-Z (getPos #\Z alpha)) (print pos-Z) (write-line "") ) ; ends function ; Call the main function. (main) ------------------------------------