lispdoc - results for constantp

(constantp form &optional (environment nil envp))
Function: True of any FORM that has a constant value: self-evaluating objects, keywords, defined constants, quote forms. Additionally the constant-foldability of some function calls special forms is recognized. If ENVIRONMENT is provided the FORM is first macroexpanded in it.
(defun maybe-temp (l exp)
  "Generate a temporary variable, if needed."
  (if (constantp exp)
      (let ((temp (gensym "TEMP")))
        (add-var l temp exp)
Mentioned in:
CLtL2 - 10.3. Creating Symbols
CLtL2 - 20.1. Run-Time Evaluation of Forms
HyperSpec - Function CONSTANTP