previous | index | next

Quoting Expressions

List items can be nonnumbers:
          (list + 2 3) ⇒ (#<primitive:+> 2 3)
Q: How to construct (+ 2 3)?
A:        (list '+ 2 3) ⇒ (+ 2 3)
Quoting suppresses the evaluation of any expression:
          (1 2 3) ⇒ Error: 1 not a procedure

          '(1 2 3) ⇒ (1 2 3)

          (car '(1 2 3)) ⇒ 1

          (cdr '(1 2 3)) ⇒ (2 3)

previous | index | next