► |  | Reference: PLT Scheme

1 | Language Model
2 | Syntactic Forms
3 | Datatypes
4 | Structures
5 | Classes and Objects
6 | Units
7 | Contracts
8 | Pattern Matching
9 | Control Flow
10 | Concurrency
11 | Macros
12 | Input and Output
13 | Reflection and Security
14 | Operating System
15 | Memory Management
16 | Running PLT Scheme
| Bibliography
| Index

▼ | 11 | Macros

11.1 | Pattern-Based Syntax Matching
11.2 | Syntax Object Content
11.3 | Syntax Object Bindings
11.4 | Syntax Transformers
11.5 | Syntax Parameters
11.6 | Local Binding with Splicing Body
11.7 | Syntax Object Properties
11.8 | Syntax Certificates
11.9 | Expanding Top-Level Forms
11.10 | File Inclusion

On this page:

splicing-let-syntax
splicing-letrec-syntax
splicing-let-syntaxes
splicing-letrec-syntaxes
splicing-syntax-parameterize

Version: 4.1.4
top← prev up next →

#### 11.6`` Local Binding with Splicing Body

(require scheme/splicing)

The bindings documented in this section are provided by the scheme/splicing library, not scheme/base or scheme.

splicing-let-syntax

splicing-letrec-syntax

splicing-let-syntaxes

splicing-letrec-syntaxes

Like let-syntax, letrec-syntax, let-syntaxes, and letrec-syntaxes, except that in a definition context, the body forms are spliced into the enclosing definition context (in the same as as for begin).

Examples:

> (splicing-let-syntax ([one (lambda (stx) #'1)])
(define o one))

> o
1
> one
reference to undefined identifier: one

splicing-syntax-parameterize

Like syntax-parameterize, except that in a definition context, the body forms are spliced into the enclosing definition context (in the same as as for begin), as long as the body forms are valid in an internal-definition context. In particular, require and provide forms cannot appear in the body of splicing-syntax-parameterize, even if splicing-syntax-parameterize is used in a module body.

Examples:
> (define-syntax-parameter place (lambda (stx) #'"Kansas"))
> (define-syntax-rule (where) `(at ,(place)))
> (where)
(at "Kansas")

> (splicing-syntax-parameterize ([place (lambda (stx) #'"Oz")])
(define here (where)))

> here
(at "Oz")

top← prev up next →