title: Scheme programming sum function overloading
body: <p>Define a function <code>sum</code>, which takes two numbers, or two real functions, and returns their <em>sum</em>. E.g.</p>
  
  <pre><code>(sum 1 2) =&gt; 3
  ((sum cos exp) 0) =&gt; 2
  </code></pre>
  
  <p>I get that for the sum of two numbers the code would be the following:</p>
  
  <pre><code>(define sum (lambda (x y)
    (+ x y)))
  </code></pre>
  
  <p>But what would be the code for the two real functions...? How would I do this? can anyone please help?</p>
  
  <p>Also how would I do this:</p>
  
  <blockquote>
    <p>Define a function <code>sum-all</code> which works like <code>sum</code>, but works on a <em>list</em> of numbers or a <em>list</em> of functions. Assume the list contains at least one element. 
     E.g.</p>
  
  <pre><code>(sum-all (list 1 2 3)) =&gt; 6
  
  ((sum-all (list cos sin exp)) 0) =&gt; 2
  </code></pre>
  </blockquote>
  
  <p>Note: this is not homework... I was going through a past midterm.</p>