► |  | How to Design Programs Languages

1 | Beginning Student
2 | Beginning Student with List Abbreviations
3 | Intermediate Student
4 | Intermediate Student with Lambda
5 | Advanced Student
| Index

▼ | 2 | Beginning Student with List Abbreviations

2.1 | Quote
2.2 | Quasiquote
2.3 | Primitive Operations
2.4 | Unchanged Forms

On this page:

quasiquote
unquote
unquote-splicing

top ← prev up next →

#### 2.2`` Quasiquote

`quasiquoted

( quasiquote quasiquoted)

Creates symbols and abbreviates nested lists, but also allows escaping to expression “unquotes.”

Normally, this form is written with a backquote, `, like `(apple ,( + 1 2)), but it can also be written with quasiquote, like ( quasiquote (apple ,( + 1 2))).

,quasiquoted

( unquote expr)

Under a single quasiquote, ,expr escapes from the quote to include an evaluated expression whose result is inserted into the abbreviated list.

Under multiple quasiquotes, ,expr is really ,quasiquoted, decrementing the quasiquote count by one for quasiquoted.

Normally, an unquote is written with ,, but it can also be written with unquote.

,@quasiquoted

( unquote-splicing expr)

Under a single quasiquote, ,@expr escapes from the quote to include an evaluated expression whose result is a list to splice into the abbreviated list.

Under multiple quasiquotes, a splicing unquote is like an unquote; that is, it decrements the quasiquote count by one.

Normally, a splicing unquote is written with ,, but it can also be written with unquote-splicing.

top ← prev up next →