title: Proper commenting for functional programming
body: <p>I've been learning scheme, and I just realized that I don't really know how to properly comment my functional scheme code. I know <em>how</em> to add a comment of course - you add a <code>;</code> and put your comment after it. My question is <em>what</em> should I put in my comments, and where should I comment for maximum readability and comprehensability for other programmers reading my code?</p>
  
  <p>Here's a code snippet I wrote. It's a function called <code>display-n</code>. It can be called with any number of arguments and outputs each argument to the screen in the order that they are provided.</p>
  
  <pre><code>(define display-n
    (lambda nums
      (letrec ((display-n-inner 
                (lambda (nums)
                  (display (car nums))
                  (if (not (equal? (cdr nums) (quote ()))
                      (display-n-inner (cdr nums))))))
        (display-n-inner nums))))
  </code></pre>
  
  <p>Edit: Improved tabbing and replaced <code>'()</code> with <code>(quote ())</code> to avoid SO messing up the formatting.</p>
  
  <p>I'm just not sure how/where to add comments to make it more understandable. Some scheme code I've seen just has comments at the top, which is great if you want to <em>use</em> the code, but not helpful if you want to understand/modify it.</p>
  
  <p>Also - how should I comment macros?</p>