emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master 9239be8e76: ; Fix documentation of 'compiled-function-p' (bug


From: Stefan Monnier
Subject: Re: master 9239be8e76: ; Fix documentation of 'compiled-function-p' (bug#56648)
Date: Sun, 14 Aug 2022 13:35:10 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

>  @defun compiled-function-p object
>  This function returns @code{t} if @var{object} is a function object
> -implemented in byte-code or machine code.
> +that was either byte-compiled (@pxref{Byte Compilation}) or
> +natively-compiled (@pxref{Native Compilation}).
>  @end defun

Hmm... it also returns t if the function is a built-in or provided by
a dynamically loaded module, which is why I had kept the wording less specific.

I guess that's also why Lars suggested to use
`not-compiled-function-p` instead.  The way I think of it, the main
property of a `compiled-function` is that it's a function and it can't
usefully be passed to `byte-compile`.

FWIW, Common Lisp defines the type as follows:

    Any function may be considered by an implementation to be
    a compiled function if it contains no references to macros that
    must be expanded at run time, and it contains no unresolved
    references to load time values.  See Section 3.2.2 (Compilation
    Semantics).

    Functions whose definitions appear lexically within a file that has
    been compiled with compile-file and then loaded with load are of
    type compiled-function. Functions produced by the compile function
    are of type compiled-function. Other functions might also be of type
    compiled-function.


-- Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]