Function: cconv--lifted-arg

cconv--lifted-arg is a byte-compiled function defined in cconv.el.gz.

Signature

(cconv--lifted-arg VAR ENV)

Documentation

The argument to use for VAR in λ-lifted calls according to ENV.

This is used when VAR is being shadowed; we may still need its value for such calls.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/cconv.el.gz
(defun cconv--lifted-arg (var env)
  "The argument to use for VAR in λ-lifted calls according to ENV.
This is used when VAR is being shadowed; we may still need its value for
such calls."
  (let ((mapping (cdr (assq var env))))
    (pcase-exhaustive mapping
      (`(internal-get-closed-var . ,_)
       ;; The variable is captured.
       mapping)
      (`(car-safe ,exp)
       ;; The variable is mutably captured; skip
       ;; the indirection step because the variable is
       ;; passed "by reference" to the λ-lifted function.
       exp)
      (_
       ;; The variable is not captured; use the (shadowed) variable value.
       ;; (If the mapping is `(car-safe SYMBOL)', SYMBOL is always VAR.
       var))))