I am trying to implement a function which when called return a factorial of numbers in list. For example (fact ‘(2 4 3)) => (2 24 6) but mine is not working. I am pretty sure that the logic is correct for my implementation just I can not find my syntax error. So if you could have a look and give some feedback it would be great here is the code:
(defun fact (list)
(cond ((null list) 0)
((zerop (first list) 1))
(* first list(fact (rest list)))
))
What you appear to be trying to do is apply a factorial function to each member of a list and collect the results in a list.
For this you need a factorial function and
mapcar.