Tags: patch The two patches below make Emacs use a dedicated type to represent interpreted-function values. Change `function` so that when evaluating #'(lambda ...) we return an object of type `interpreted-function` rather than a list starting with one of `lambda` or `closure`. The new type reuses the existing PVEC_CLOSURE (nee PVEC_COMPILED) tag used for byte-code function and tries to align the corresponding elements: - the arglist, the docstring, and the interactive-form go in the same slots as for byte-code functions. - the body of the function goes in the slot used for the bytecode string. - the lexical context goes in the slot used for the constants of bytecoded functions. The first point above means that `help-function-arglist`, `documentation`, and `interactive-form`s don't need to distinguish interpreted and bytecode functions any more. Main benefits of the change: - We can now reliably distinguish a list from a function value. This removes some ambiguity in cases where the data can be made of a list or a function, such as `run-hooks` or completion tables. - `cl-defmethod` can dispatch on `interactive-function`. Dispatch on `function` also works now for interpreted functions (but still won't work for functions represented as lists or as symbols, of course). - Function values are now self-evaluating. That was already the case when byte-compiled, but not when interpreted since (eval '(closure ...)) signals a void-function error. That also avoids false-positive warnings about "don't quote your lambdas" when doing things like `(mapcar ',func ...)`. Stefan