2.2 Quasiquote
| |
|
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))).
| |
|
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.
| |
|
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.