Function: lexical-let*

lexical-let* is a macro defined in cl.el.gz.

Signature

(lexical-let* BINDINGS BODY)

Documentation

Like let*, but lexically scoped.

The main visible difference is that lambdas inside BODY, and in successive bindings within BINDINGS, will create lexical closures as in Common Lisp. This is similar to the behavior of let* in Common Lisp.

View in manual

Source Code

;; Defined in /usr/src/emacs/lisp/obsolete/cl.el.gz
(defmacro lexical-let* (bindings &rest body)
  "Like `let*', but lexically scoped.
The main visible difference is that lambdas inside BODY, and in
successive bindings within BINDINGS, will create lexical closures
as in Common Lisp.  This is similar to the behavior of `let*' in
Common Lisp.
\n(fn BINDINGS BODY)"
  (declare (indent 1) (debug let))
  (if (null bindings) (cons 'progn body)
    (setq bindings (reverse bindings))
    (while bindings
      (setq body (list `(lexical-let (,(pop bindings)) ,@body))))
    (car body)))