Function: byte-compile-recurse-toplevel

byte-compile-recurse-toplevel is a byte-compiled function defined in bytecomp.el.gz.

Signature

(byte-compile-recurse-toplevel FORM NON-TOPLEVEL-CASE)

Documentation

Implement eval-when-compile and eval-and-compile.

Return the compile-time value of FORM.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/bytecomp.el.gz
(defun byte-compile-recurse-toplevel (form non-toplevel-case)
  "Implement `eval-when-compile' and `eval-and-compile'.
Return the compile-time value of FORM."
  ;; Macroexpand (not macroexpand-all!) form at toplevel in case it
  ;; expands into a toplevel-equivalent `progn'.  See CLHS section
  ;; 3.2.3.1, "Processing of Top Level Forms".  The semantics are very
  ;; subtle: see test/lisp/emacs-lisp/bytecomp-tests.el for interesting
  ;; cases.
  (setf form (macroexp-macroexpand form byte-compile-macro-environment))
  (if (eq (car-safe form) 'progn)
      (cons 'progn
            (mapcar (lambda (subform)
                      (byte-compile-recurse-toplevel
                       subform non-toplevel-case))
                    (cdr form)))
    (funcall non-toplevel-case form)))