As a Lisp (and functional programming) newbie, I wrote the following code that finds the sum of all the multiples of 3 or 5 below 1000, and I suspect that it is lousy:(defun multiple-of-3-or-5 (x)     (or (eq (mod x 3) 0) (eq (mod x 5) 0)) )(defun generate-list (min max)     (cond ((> min max) nil)           (t (cons min (generate-list (+ min 1) max )))))(defun my-sum (my-list)     (cond ((atom my-list) 0)           (t (+ (cond ((multiple-of-3-or-5 (car my-list)) (car my-list))               (t 0))             (my-sum (cdr my-list))))))Any general advice is most welcome. Specifically, I have these questions (other than what you could say):I had to extend the stack multiple times (using LispWorks) to get a result. Is my use of recursion wrong? Should I prefer iterative approach over recursion in Lisp too? (as in imperative languages)Should I use the loop macro if I am to solve it in iterative fashion? 
Finding the sum of all the multiples of 3 or 5 below 1000
beginner;programming challenge;lisp;common lisp
Is my use of recursion wrong?It's not wrong, but it's unnecessarily complex. There's no need to create a list and recurse over it when you could simply iterate over the numbers.Should I prefer iterative approach over recursion in Lisp too? (as in imperative languages)Iteration is perfectly acceptable in functional languages! Functional programmers talk about recursion a lot, because it's more flexible (and thus more powerful) than iteration, but we use iteration too, when we don't need that power. This is why most functional languages have plenty of iteration tools built in  Common Lisp's mapcar, some, reduce, loop and do, for example.Use iteration when it's the simplest solution, and recursion when you need it.Should I use the loop macro if I am to solve it in iterative fashion?Sure, loop is the simplest way to do this, so it's what most Common Lispers would do. It's a bit complex for beginners, though; do might be easier to learn.Comments on the implementationgenerate-list is traditionally called range or iota. Rather than define it yourself, you can get it from a library such as Alexandria.The explicit recursion in my-sum is not necessary. It's simpler (and clearer) to use the standard sequence functions remove-if-not and reduce instead:(reduce #'+ (remove-if-not #'multiple-of-3-or-5 (iota 1000)))The best way to test for the end of a list is endp, not atom. (It also signals an error on improper lists.)(1+ min) is a little clearer than (+ min 1).