Go to the first, previous, next, last section, table of contents.


Quoting

As the above sections explain some types of Lisp object have special meaning to the Lisp evaluator (namely the symbol and list types) this means that if you want to refer to a symbol or a list in a program you can't (yet) because the evaluator will treat the form as either a variable reference or a function call respectively.

To get around this Lisp uses something called quoting, the quote special form simply returns its argument, without evaluating it. For example,

(quote my-symbol)
    => my-symbol

the quote form prevents the my-symbol being treated as a variable -- it is effectively `hidden' from the evaluator.

Writing `quote' all the time would be a bit boring so there is a shortcut: the Lisp reader treats any form x preceded by a single quote character (`'') as the form (quote x). So the example above would normally be written as,

'my-symbol
    => my-symbol

Special Form: quote form
This special form returns its single argument without evaluating it. This is used to quote constant objects to prevent them from being evaluated.


Go to the first, previous, next, last section, table of contents.