User Tools


Special Operator QUOTE

Syntax

  • quote objectobject

Arguments and Values

  • object - an object; not evaluated.

Description

The special operator quote just returns object.

The consequences are undefined if literal objects (including quoted objects) are destructively modified.

Examples

(defparameter *a* 1)

*A*

(quote (defparameter a 3))

(DEFPARAMETER A 3)

*a*

1

'*a*

A

*a* <r>(QUOTE *A*)</r> '*a*

(QUOTE (QUOTE *A*))

(defparameter a 43)

43

(list a (cons a 3))

(43 (43 . 3))

(list (quote a) (quote (cons a 3)))

(A (CONS A 3))

1

1

'1

1

"foo"

"foo"

'"foo"

"foo"

(car '(a b))

A

'(car '(a b))

(CAR (QUOTE (A B)))

#(car '(a b))

#(CAR (QUOTE (A B)))

'#(car '(a b))

#(CAR (QUOTE (A B)))

Affected By

None.

Exceptional Situations

None.

See Also

{\secref\Evaluation}, {\secref\QuoteMacro},

{\secref\ConstantModification}

Notes

The textual notation 'object is equivalent to (quote object); see section {\secref\ConstantModification}.

Some objects, called self-evaluating objects, do not require quotation by quote. However, symbols and lists are used to represent parts of programs, and so would not be useable as constant data in a program without quote. Since quote suppresses the evaluation of these objects, they become data rather than program.

\issue{CONSTANT-MODIFICATION:DISALLOW}