bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#13676: 24.2.93; Compiler warnings with (defalias #'symbol ...)


From: Stefan Monnier
Subject: bug#13676: 24.2.93; Compiler warnings with (defalias #'symbol ...)
Date: Sun, 10 Feb 2013 23:01:20 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

> |  [...]  But unlike `quote', it also serves as a note to the Emacs
> |evaluator and byte-compiler that FUNCTION-OBJECT is intended to be used
> |as a function.  [...]

Right, this means that #'foo is a reference to the function stored in `foo'.

> (defalias #'my-package-end-of-line

So, this is weird, because you're not referring to the function stored
in `my-package-end-of-line' here, instead you really want to set the
`symbol-function' slot of the symbol, so the argument you want to pass
to `defalias' is not a function but a symbol.

Both work in practice, but the intention expressed by the use of #' is
incorrect here.

>   (if (fboundp #'end-of-visual-line)

Similarly, here it should be (fboundp 'end-of-visual-line) since
fboundp's argument should be a symbol, not a function.


        Stefan





reply via email to

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