title: Specification of conses
body: <p>The Wikipedia-page about <a href="https://en.wikipedia.org/wiki/CAR_and_CDR" rel="nofollow noreferrer">car and cdr</a> says that a <code>cons</code> is a pair of pointers.</p>
  
  <p>The following code seems to confirm that:</p>
  
  <pre class="lang-el prettyprint-override"><code>(progn
    (setq a '(1 . 2))
    (setq b a)
    (setf (car b) 10)
    (print a))
  </code></pre>
  
  <p>The evaluation of that form gives the cons <code>(10 . 2)</code>. Setting the <code>car</code> of <code>b</code> changes the <code>car</code> of <code>a</code>. You can try that in the <a href="http://www.compileonline.com/execute_lisp_online.php" rel="nofollow noreferrer">online repl at compileonline.com</a>.</p>
  
  <p>Where is that behavior defined in the <a href="http://cvberry.com/tech_writings/notes/common_lisp_standard_draft.html" rel="nofollow noreferrer">Common Lisp specification</a>?</p>
  
  <p>(I've read some of the text but couldn't find the section pin-pointing that behavior.)</p>
  
  <p>Interestingly the Wikipedia page on conses says "<code>cons</code> constructs memory objects which hold two <strong>values</strong> or pointers to values". If the atom 1 would directly be stored in the cons object then changing <code>b</code> wouldn't change <code>a</code>, would it?</p>
  
  <p>I assume above that <code>a</code> and <code>b</code> hold the cons objects and not pointer to conses.
  Even if the actual lisp implementation works with pointers this should not be visible on repl-level or should it according to the spec? One could achieve a similar effect when one assumes that <code>a</code> and <code>b</code> hold pointers that both point to the same <code>cons</code>.
  <code>Consing</code>, i.e., the construction of lists through repeated application of <code>cons</code>, supports the assumption that conses are represented by pointers in symbol values.</p>
  
  <p>The following two forms are equivalent:</p>
  
  <pre class="lang-el prettyprint-override"><code>(let ((a '(1)))
    (setq b (cons 2 a)))
  </code></pre>
  
  <pre class="lang-el prettyprint-override"><code>(setq b '(2 1))
  </code></pre>