title: How do I convert a string to a symbol for use as a key in the Lisp "assoc" function?
body: <p>I have this association-list in Common Lisp:</p>
  
  <pre><code>(defvar base-list (list (cons 'a 0) (cons 2 'c)))
  </code></pre>
  
  <p>I have to call <code>assoc</code> when my argument is of type <code>string</code>.</p>
  
  <p>For the pair <code>(A . 0)</code> I have to convert "a" to a symbol, and for the pair <code>(2 . C)</code> I have to convert "2" to a symbol. How can I do that? </p>
  
  <p>This should work like this: </p>
  
  <pre><code>CL-USER 28 : 1 &gt; (assoc (convert-string-to-symbol "a") base-list)
  (A . 0)
  CL-USER 28 : 1 &gt; (assoc (convert-number-to-symbol "2") base-list)
  (2 . C)
  </code></pre>
  
  <p>I tried using <code>intern</code> but got <code>NIL</code>:</p>
  
  <pre><code>CL-USER 29 : 1 &gt; (assoc (intern "a") base-list)
  NIL
  </code></pre>