Try with a function that takes an argument and has a body:
(let ((foo 233)) (lambda (x) (* x foo)))
;; ==> (closure ((foo . 233)) (x) (* x foo))
The Closures section of the Elisp Reference manual says:
Currently, an Emacs Lisp closure object is represented by a list with
the symbol ‘closure’ as the first element, a list representing the
lexical environment as the second element, and the argument list and
body forms as the remaining elements:
;; lexical binding is enabled.
(lambda (x) (* x x))
⇒ (closure (t) (x) (* x x))
However, the fact that the internal structure of a closure is exposed to
the rest of the Lisp world is considered an internal implementation
detail. For this reason, we recommend against directly examining or
altering the structure of closure objects.
Why the t
is added in this case is an implementation detail (which is subject to change).
EDIT: Documenting the t
seemed unnecessary in the light of the above. Indeed, the "single symbol VAR" sentence that @phils points out in a comment below, was added to the parenthetical section that @shynur complained about above and the t
part was excised (see commit 60560cc7adfe685ef8c04623a6d019dc659123b1 and bug#62840), where Stefan Monnier mentions that it is still possible apparently for a t
to be added, but it is an implementation detail and not important to document. But it is not clear to me at least when and where that t
might be added.
(let ((test 233)) (lambda ())) ;; ==> (closure (t) nil)