New answers tagged list
4
Are there cases in which [backquote] is the best choice
Yes, when constructing complex list expressions that involve a lot of quoting, unquoting, and splicing. The best example of this is macro bodies. See the example in (info "(elisp) Defining Macros"):
(defmacro t-becomes-nil (variable)
`(if (eq ,variable t)
(setq ,variable nil)))
...
1
Quoted values are established at read-time, and so incur no eval-time cost to build. So there ought to be a slight efficiency benefit to using a quoted value in cases where it's safe to do that.
It it's a genuinely constant value, then quoting is the best choice.
Are there any cases in which list should be avoided?
quote returns the same1 value every time,...
0
list and quote do not function in the same way. list
evaluates its arguments, and quote does not:
(list 1 2 (+ 1 2)) ; => (1 2 3)
(quote (1 2 (+ 1 2))) ; => (1 2 (+ 1 2))
Top 50 recent answers are included
Related Tags
list × 116org-mode × 14
mapping × 9
string × 6
quote × 5
functions × 4
sorting × 4
elisp × 3
association-lists × 3
data-structures × 3
lisp × 3
debugging × 2
regular-expressions × 2
search × 2
font-lock × 2
flycheck × 2
interactive × 2
motion × 2
time-date × 2
arguments × 2
backquote × 2
numbers × 2
iteration × 2
read × 2
format × 2