title: Palindrome of sublists in scheme
body: <p>I have a working palindrome that returns true/false for a single list with atoms by taking the car and comparing it to reverse car.  It then throws away the first and last with cdr (reverse (cdr list)).  </p>
  
  <p>I'd like to make it work with atoms within sublists so that '(a b) c (b a)) would return true.</p>
  
  <p>I'm trying to have it first check if car is a list and if so compare caar and reverse caar until it's null then continue on.<br>
  I'm getting "Object #f is not applicable".</p>
  
  <pre><code>(DEFINE (pdrome lst)
    (cond
      ; ((NOT (LIST? lst)) DISPLAY "USAGE: (palindrome [list])" )
      ((null? lst) #t)
       ((null? (cdr lst)) #t)
  
       ((LIST? (car lst))
         ((null? (car lst) ) () )
         ((null? (cdr lst) ) () )
      ((equal? (caar lst) (caar (reverse lst)))
      (pdrome (cdar (reverse(cdar lst))))))
  
       ((equal? (car lst) (car(reverse lst))) 
        (pdrome (cdr (reverse (cdr lst)))))
  
          (else #F) ) )
  </code></pre>
  
  <p>I also tried to do it this way so it wouldn't be nested but I can't figure this out. Any tips or hints appreciated.  Thanks!</p>
  
  <pre><code>(LIST? car lst)  
  palindrome (append (caar lst) (caar (reverse lst)))
  </code></pre>