Add, subtract and multiply code
(write-line “Add subtract or multiply!”)
(defun multiply (X Y)  
  (* X Y ))
 
 
(defun add (x y )
( + x y )
)
 
(defun subtract (x y )
( – x y )
)
 
 
(print (multiply 4 5))
(print (add 1 2 )
(print (subtract 1 2))

Factorial code

(defun factorial (n)
(if (< n 2)
1
(* n (factorial (- n 1)))))

   (print (factorial 6))

Imperative Programming 

Java, C ++ , etc

Functional Programming

Telling the computer what you want done (Lisp!)

Declarative programming

The opposite of imperative

Lisp was used a long time ago for AI applications because of its power and simplicity. We still use it today.

 lisplogo_fancy_256

Advertisements