(defun minimum (lst)
(do
;Step 1: Define Variables
((numbers lst)
(min 0))
;Step 2: Conditions for exiting loop and what to return
((null (cdr numbers)) min)
;Step 3: Program body
( (setq min (smaller((car numbers)(cadr numbers))))
(setq numbers (cdr numbers)) )
;I don’t understand why the compiler considers my setq min an illegal function.
;Even if I try to set min to a number it kicks it out
))
;test string
(minimum ‘(4 1 2 4 6 7))
This program doesn’t actually run because I suck at LISP. Peter Norvig does not suck at LISP.
(defun smaller(Num1 Num2)
(if (< Num1 Num2) Num1 Num2) ) ;test string (smaller 5 1) ;Question 2