Function: declare

declare is a macro defined in subr.el.gz.

Signature

(declare &rest SPECS)

Documentation

Do not evaluate any arguments, and return nil.

If a declare form appears as the first form in the body of a defun or defmacro form, SPECS specifies various additional information about the function or macro; these go into effect during the evaluation of the defun or defmacro form.

The possible values of SPECS are specified by defun-declarations-alist and macro-declarations-alist.

For more information, see info node (elisp)Declare Form.

This macro has :after advice: cl--pass-args-to-cl-declare.

View in manual

Probably introduced at or before Emacs version 25.1.

Source Code

;; Defined in /usr/src/emacs/lisp/subr.el.gz
(defmacro declare (&rest specs)
  "Do not evaluate any arguments, and return nil.
If a `declare' form appears as the first form in the body of a
`defun' or `defmacro' form, SPECS specifies various additional
information about the function or macro; these go into effect
during the evaluation of the `defun' or `defmacro' form.

The possible values of SPECS are specified by
`defun-declarations-alist' and `macro-declarations-alist'.

For more information, see info node `(elisp)Declare Form'."
  ;; `declare' is handled directly by `defun/defmacro' rather than here.
  ;; If we get here, it's because there's a `declare' somewhere not attached
  ;; to a `defun/defmacro', i.e. a `declare' which doesn't do what it's
  ;; intended to do.
  (let ((form `(declare . ,specs)))  ;; FIXME: WIBNI we had &whole?
    (macroexp-warn-and-return
     (format-message "Stray `declare' form: %S" form)
     ;; Make a "unique" harmless form to circumvent
     ;; the cache in `macroexp-warn-and-return'.
     `(progn ',form nil) nil 'compile-only)))