Function: cconv-closure-convert

cconv-closure-convert is a byte-compiled function defined in cconv.el.gz.

Signature

(cconv-closure-convert FORM &optional DYNBOUND-VARS)

Documentation

Main entry point for closure conversion.

FORM is a piece of Elisp code after macroexpansion. DYNBOUND-VARS is a list of symbols that should be considered as using dynamic scoping.

Returns a form where all lambdas don't have any free variables.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/cconv.el.gz
;;;###autoload
(defun cconv-closure-convert (form &optional dynbound-vars)
  "Main entry point for closure conversion.
FORM is a piece of Elisp code after macroexpansion.
DYNBOUND-VARS is a list of symbols that should be considered as
using dynamic scoping.

Returns a form where all lambdas don't have any free variables."
  (let ((cconv--dynbound-variables dynbound-vars)
	(cconv-freevars-alist '())
	(cconv-var-classification '()))
    ;; Analyze form - fill these variables with new information.
    (cconv-analyze-form form '())
    (setq cconv-freevars-alist (nreverse cconv-freevars-alist))
    (prog1 (cconv-convert form nil nil) ; Env initially empty.
      (cl-assert (null cconv-freevars-alist)))))