title: How to define a function-local constant in Common Lisp?
body: <p>I have a function like this:</p>
  <pre><code>(defun lookup-data (index-key)
     (let* ((key-table '(&quot;key0&quot; &quot;key1&quot; &quot;key2&quot; ...))
            (index       (position index-key key-table :test #'string-equal))
            ...
     ; do stuff with index, among other things
   )
  </code></pre>
  <p>The key table (really just a list of strings, but it's being used as a lookup table to map a string to an index number) is a literal value known at read time. I was thinking perhaps it should be made a <code>defparameter</code> or <code>defconstant</code>, but it's not used anywhere outside this one function.  I assume the fact that it's a literal means that most compilers can do constant-based optimization on it as-is, but is there something else I should do to mark it as a constant? What are the options here?</p>