title: Lisp function adding odd numbers from a subset
body: <p>I need to make a function in a clisp that would add all odd numbers from a set.For example subset (2,8), the result would be 15(3+5+7).any suggestions?
  I do have something like this, where a is the beginning of a set and b is the end of it.</p>
  
  <pre><code>(defun add (a b)
  (if(and(&lt; a x) (&gt; b x))
      (if(even(x))
          ((setq ( x (+a 1))) (+ x 2))
          ((setq(x a)) (+ x 2))
              )))
  </code></pre>
  
  <p>EDIT:</p>
  
  <pre><code>(defun add (a b)
  (if(and(&lt; a x) (&gt; b x))
      (if(evenp x))
          ((setq ( x (+a 1))
              (loop for x from a to b do (+ x 2))))
          ((setq(x a)) (+ x 2)
              (loop for x from a to b do (+ x 2)))
                  ))
  </code></pre>