Expressions can be prevented from being evaluated using the quote
operator:
Expressions that evaluate to themselves are unaffected by quotation:
The shorthand for quotation is use a single quote:
Another way to write many strings is to simply quote their name:
When you want to quote some parts of an expression, but want other parts to be evaluated, use quasiquote
and unquote
:
A different way to unquote expressions is unquote-splicing
, which takes the values contained in a nested list and places them in the enclosing one.
The shorthand for unquote-splicing
is ,@
.
The shorthand for quasiquotation is `
for quasiquote
and ,
for unquote
:
Quoting names and strings results in strings that would evaluate to the quoted expression.
This is also true for expressions inside lists.