title: implementing the scan function in scheme?
body: <p>I am trying to implement a function (let's call it scan) that takes three arguments. The first is a two argument procedure, the second is the initial value for the procedure, and the third is a list of items to process using the procedure. For example:</p>
  
  <pre><code>(scan + 0 '())==&gt; '()
  (scan + 0 '(1))==&gt; '(1)
  (scan + 0 '(1 2 3 4 5));; 1+0, 2+1+0, 3+2+1+0, ...==&gt; '(1 3 6 10 15)
  </code></pre>
  
  <p>and so on...
  I have coded something for finding the prefix sum that takes two arguments. I tried using that but it didn't work. How can I approach this problem?</p>