title: Behavour of nested quotes in Scheme and Racket
body: <p>While writing a function in Racket I accidently put two single quotes in front of a symbol instead of one.  i.e. I accidently wrote ''a  and discovered some behaviour of nested quotes that seems strange.  I'm using DrRacket and tested this with both the Racket lang and the R5RS lang. </p>
  
  <pre><code>(write (pair? (quote (quote a))))
  </code></pre>
  
  <p>prints: #t .</p>
  
  <pre><code>(write (car (quote (quote a))))
  </code></pre>
  
  <p>prints: quote</p>
  
  <p>But</p>
  
  <pre><code>(write (quote (quote a)))
  </code></pre>
  
  <p>and</p>
  
  <pre><code>(write '(quote a)))
  </code></pre>
  
  <p>Both print: 'a</p>
  
  <p>Can someone tell me why in Scheme (and Racket) the function pair? interprets (quote (quote a))) as a pair of two elements quote and a , but the function write prints out 'a instead of (quote a) .</p>