tags:

views:

152

answers:

2

What does this do?

(add-hook 'compilation-mode-hook #'my-setup-compile-mode)

...and is it different than

(add-hook 'compilation-mode-hook 'my-setup-compile-mode)
+8  A: 

There is no difference:

(eq 'my-add #'my-add)

yields t

The # can be used in front of a lambda expression indicating to the byte-compiler that the following expression can be byte compiled, see the docs for Anonymous Functions. But there's nothing to compile in the case of a symbol.

In general, it is used in the printed representation along with the left angle bracket (<) to indicate that the object printed is a description (but cannot be read). For example:

#<buffer foo.txt>

It is also used in constructs by the reader to represent circular structures. See the docs for Read Syntax for Circular Objects.

And then you have its use for denoting the base for integers, e.g. #x2c -> 44.

Plus more I'm sure.

Trey Jackson
Whoa, awesome. The emacs/elisp encyclopedia.
Cheeso
+1  A: 

The should-be-comprehensive list can be found at the top of the Emacs lisp reference index.

phils