title: Counts of repeated elements in a list
body: <p>This program takes a list where elements are repeated, e.g <code>L = (a a a b b b c c c d)</code>, and output a list of items and number of repetition e.g <code>((a 3)(b 3)(c 3) d)</code>  </p>
  
  <pre><code>(define counter 0)
  (define (compress liste)
  (if (or (null? liste) (null? (cdr liste)))
     liste
  (let ((compressed-cdr (compress (cdr liste)))) 
     (if (equal? (car liste) (car compressed-cdr))
     ((+ counter 1) compressed-cdr)
    ((cons (car liste) counter) (= counter 0) (compressed-cdr))))
                         ))
  </code></pre>
  
  <p>However, I get this error:</p>
  
  <blockquote>
    <p>Error: application: not a procedure; expected a procedure that can be applied to arguments <br/>
    given: 1  arguments ...</p>
  </blockquote>
  
  <p>The error is at the true predicate of the second if condition.</p>