title: scheme define cdr contract violation expected pair given '()
body: <p>Given the define tree:</p>
  
  <pre><code>(define tree
    '("S" (("-" ("A" 3333) ("A" 4444))
           ("W" (("+" ("R" 0) ("R" 1))
                 ("+" ("R" 1) ("R" 2))
                 ("+" ("R" 2) ("R" 3))
                 ("+" ("R" 3) ("R" 4))
                 ("+" ("R" 4) ("R" 5)))
                (("-" ("R" 0) ("R" 1))
                 ("-" ("R" 1) ("R" 2))
                 ("-" ("R" 2) ("R" 3))   
                 ("-" ("R" 3) ("R" 4))
                 ("-" ("A" 1000) ("A" 2000)))))))
  </code></pre>
  
  <p>I am trying to access the values. Doing <code>car</code> and <code>cdr</code> works for the first and getting the rest but when I try to get a specific value like <code>("A" 1000)</code> I get the error:</p>
  
  <blockquote>
    <p>cdr: contract violation<br>
      expected: pair?<br>
      given: '(). </p>
  </blockquote>
  
  <p>I have tried <code>(car (cdr (cdr (cdr '(tree)))))</code>, <code>(cdddr tree)</code> but I always get that error. Any helpful tips will be appreciated.</p>