quote -- r7rs Definition
§

Kind
§

syntax;

Implemented by
§

Syntax signature
§

Syntax keywords:

Syntax variants:

Exports
§

Exports recursive
§

Description
§

(quote <datum>)
'<datum>
<constant>

(quote <datum>) evaluates to <datum>. <Datum> can be any external representation of a Scheme object (see section on external representations). This notation is used to include literal constants in Scheme code.

(quote a)                     ===>  a
(quote #(a b c))     ===>  #(a b c)
(quote (+ 1 2))               ===>  (+ 1 2)

(quote <datum>) can be abbreviated as '<datum>. The two notations are equivalent in all respects.

'a                   ===>  a
'#(a b c)            ===>  #(a b c)
'()                  ===>  ()
'(+ 1 2)             ===>  (+ 1 2)
'(quote a)           ===>  (quote a)
''a                  ===>  (quote a)

Numerical constants, string constants, character constants, vector constants, bytevector constants, and boolean constants evaluate to themselves; they need not be quoted.

'145932      ===>  145932
145932       ===>  145932
'"abc"       ===>  "abc"
"abc"        ===>  "abc"
'#\space     ===>  #\space
#\space      ===>  #\space
'#(a 10)     ===>  #(a 10)
#(a 10)      ===>  #(a 10)
'#u8(64 65)  ===>  #u8(64 65)
#u8(64 65)   ===>  #u8(64 65)
'#t          ===>  #t
#t           ===>  #t

As noted in section on storage model, it is an error to attempt to alter a constant (i.e. the value of a literal expression) using a mutation procedure like set-car! or string-set!.


The text herein was sourced and adapted as described in the "R7RS attribution of various text snippets" appendix.

Referenced-types
§