Okay, it's a start. Let's step back. Describe in plain English what Lisp should do just so we're on the same page.
gayelle wrote:Here is how far along I got in the code. I know that I have to take the first number but I don't know how to compare it to each other value in the list individually...
(defun minimum (lst)
"(lst)
return the minimum of a list"
(do (x lst (cdr x))
(result 0 (car x))
As far as your code goes, it isn't actually a well formed expression as the parentheses don't match. That aside, remember that DO has the form
(do bindings
stuff-that-determines-when-the-loop-exits-and-what-it-returns
forms-that-get-run-every-iteration )
The bindings are kind of like a LET form, so in your bindings you are actually setting X to NIL, LST to NIL, and CDR to X. I believe that you also wanted RESULT to get a binding as well. I think you want something more like...
(do ((x lst (cdr x)) (result 0 (car x))) ...)
Note the placement of parentheses. The "(x lst (cdr x))" bit is a basic idiom for iterating over a list, so good job there.
gayelle wrote:(defun minimum (lst)
"(lst)
return the minimum of a list"
(do (x lst (cdr x))
(setf 'a (car x))
(setf 'b (car (cdr x))
I feel like this is a small step forward. You recognize that you are interested in the relationship between A and B. Think of it this way, how would you write a function that determines if there is an element in the list that is less than a given number (given as an argument). Once you can write that, you are 80% there.
Also, I suspect that you are not working in from of a Lisp system REPL. I suspect this because nothing you have shown can actually be read by a Lisp system. You should be working in front of a REPL.