► |  | Syntax: Meta-Programming Helpers

1 | Syntax Object Helpers
2 | Module-Processing Helpers
3 | Macro Transformer Helpers
4 | Reader Helpers
5 | Non-Module Compilation And Expansion
6 | Trusting Standard Recertifying Transformers
7 | Attaching Documentation to Exports
8 | Parsing and specifying syntax
| Index

▼ | 8 | Parsing and specifying syntax

8.1 | Introduction
8.2 | Examples
8.3 | Parsing syntax
8.4 | Specifying syntax with syntax classes
8.5 | Syntax patterns
8.6 | Literal sets and Conventions
8.7 | Library syntax classes and literal sets
8.8 | Debugging and inspection tools
8.9 | Experimental

► | 8.7 | Library syntax classes and literal sets

8.7.1 | Syntax classes
8.7.2 | Literal sets

On this page:

8.7.1`` Syntax classes
expr
identifier
boolean
str
char
keyword
number
integer
exact-integer
exact-nonnegative-integer
exact-positive-integer
id
nat
static
8.7.2`` Literal sets
kernel-literals

top ← prev up next →

#### 8.7`` Library syntax classes and literal sets

##### 8.7.1`` Syntax classes

expr

Matches anything except a keyword literal (to distinguish expressions from the start of a keyword argument sequence). The term is not otherwise inspected, since it is not feasible to check if it is actually a valid expression.

identifier

boolean

str

char

keyword

number

integer

exact-integer

exact-nonnegative-integer

exact-positive-integer

Match syntax satisfying the corresponding predicates.

id

Alias for identifier.

nat

Alias for exact-nonnegative-integer.

( static predicate description) → (attributes value)
predicate : ( -> any/c any/c )
description : ( or/c string? #f)

The static syntax class matches an identifier that is bound in the syntactic environment to static information (see syntax-local-value) satisfying the given predicate. If the term does not match, the description argument is used to describe the expected syntax.

When used outside of the dynamic extent of a macro transformer (see syntax-transforming?), matching fails.

The attribute value contains the value the name is bound to.

##### 8.7.2`` Literal sets

kernel-literals

Literal set containing the identifiers for fully-expanded code (Fully Expanded Programs). The set contains all of the forms listed by kernel-form-identifier-list, plus module, #%plain-module-begin, #%require, and #%provide.

Note that the literal-set uses the names #%plain-lambda and #%plain-app, not lambda and #%app.

top ← prev up next →