Question: Lisp sigma function recursion help me trace it. I get it logically, I just need to understand this example so I can do my assignments.
Lisp sigma function recursion help me trace it. I get it logically, I just need to understand this example so I can do my assignments. I'm not sure what is happening on the 3rd and 4th line, what is x being set to. If my inputs are (sigma f 1 2) my output is 20, another example would be (sigma f 1-5). If you can help me trace it. I would post the sigma definition below. Thank you for your help.
(defun sigma (f m n)
(if (> m n) 0
(let ((x (sigma f (+ m 1) n)))
(+ (funcall f m) x) )))
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
