(quote x) x: any form
S
Suppresses evaluation.
Returns its argument verbatim. It's not expanded and it's not evaluated.
'hp ; evaluates to the symbol hp
hp ; accesses the variable bound to the symbol hp
'(1 2 3) ; evaluates to the array (1 2 3)
(1 2 3) ; error: called the integer 1 as a function
If the argument stores aliasable mutable data (such as an array or table), a deep-cloned and deep-frozen copy is returned. This makes it less likely that a quoted form will be accidentally mutated.
(let ar '(1 2 3))
(push! ar 4) ; error: mutated a frozen array
(quote x)
is usually abbreviated
as 'x
.