On Feb 11, 2009, at 9:02 PM, Tom Breton (Tehom) wrote:
Hi Tom,
maybe you can educate me: I have never understood what the "#" does
in code like the one you have here. You are using it, so maybe you
know?
- Carsten
Here, it's #' that it of interest, not # alone.
At the most direct level, it quotes the symbol with `function'
instead of
`quote'. For example:
(format "%s" ' 'foo) => "(quote foo)"
(format "%s" ' #'foo) => "(function foo)"
What it accomplishes:
* In some contexts, it is needed to get a symbol's function binding
instead of its value binding.
* It alerts the byte-compiler that it's seeing a function, so it can
perform certain optimizations (I don't know offhand exactly what).
* Stylistically, it alerts the reader.
OK, thanks a lot!
It's an imitation of Common Lisp's reader macro #' which does sort
of
the same thing.
At the syntax level, it's really a combination of # which
signals a
reader macro - though in emacs, it's all hard-coded and inextensible
- and
' which stands for the function-quote reader macro.
FWIW, what I added to lread.c was an extension of the reader macro
facility at RMS' request, so you definitely asked the right guy.
:-) Thanks for the explanations.
Tom Breton (Tehom)
_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode