Function: byte-compile-unbind

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

Signature

(byte-compile-unbind CLAUSES INIT-LEXENV PRESERVE-BODY-VALUE)

Documentation

Emit byte-codes to unbind the variables bound by CLAUSES.

CLAUSES is a let-style variable binding list. INIT-LEXENV should be a lexical-environment alist describing the positions of the init value that have been pushed on the stack. If PRESERVE-BODY-VALUE is true, then an additional value on the top of the stack, above any lexical binding slots, is preserved, so it will be on the top of the stack after all binding slots have been popped.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/bytecomp.el.gz
(defun byte-compile-unbind (clauses init-lexenv preserve-body-value)
  "Emit byte-codes to unbind the variables bound by CLAUSES.
CLAUSES is a `let'-style variable binding list.  INIT-LEXENV should be a
lexical-environment alist describing the positions of the init value that
have been pushed on the stack.  If PRESERVE-BODY-VALUE is true,
then an additional value on the top of the stack, above any lexical binding
slots, is preserved, so it will be on the top of the stack after all
binding slots have been popped."
  ;; Unbind dynamic variables.
  (let ((num-dynamic-bindings 0))
    (dolist (clause clauses)
      (unless (assq (if (consp clause) (car clause) clause)
                    byte-compile--lexical-environment)
        (setq num-dynamic-bindings (1+ num-dynamic-bindings))))
    (unless (zerop num-dynamic-bindings)
      (byte-compile-out 'byte-unbind num-dynamic-bindings)))
  ;; Pop lexical variables off the stack, possibly preserving the
  ;; return value of the body.
  (when init-lexenv
    ;; INIT-LEXENV contains all init values left on the stack.
    (byte-compile-discard (length init-lexenv) preserve-body-value)))