title: Installing a Recursive Function Using symbol-function
body: <p>A function can be installed programmatically in Common Lisp using <code>symbol-function</code> (instead of <code>defun</code>):</p>
  <pre><code>* (setf (symbol-function 'factorial)
      (compile nil (lambda (n) 
                     (if (= n 1) 
                       1 
                       (* n (factorial (- n 1)))))))
  
  ; in: SETF (SYMBOL-FUNCTION 'FACTORIAL)
  ;     (FACTORIAL (- N 1))
  ;
  ; caught STYLE-WARNING:
  ;   undefined function: COMMON-LISP-USER::FACTORIAL
  ;
  ; compilation unit finished
  ;   Undefined function:
  ;     FACTORIAL
  ;   caught 1 STYLE-WARNING condition
  #&lt;FUNCTION (LAMBDA (N)) {1003F2222B}&gt;
  </code></pre>
  <p>But as above, if the function is recursive, a warning is issued by SBCL because the function is anonymous.</p>
  <p>This problem is not encountered when using <code>defun</code>, since, as the hyperspec says:
  &quot;Evaluating defun causes function-name to be a global name for the function specified by the lambda expression&quot;.</p>
  <p>Can the warning be averted by providing the proper function name when using <code>symbol-function</code>?</p>
  <p>(PS: At first, I thought the <code>compile</code> function could be given the function name, but that is only for macros.)</p>