Version: 4.1.5
1 Syntax Object Helpers
1.1 Deconstructing Syntax Objects
Returns #t if v is either the empty list or a
syntax object representing the empty list (i.e.,
syntax-e on the syntax object returns
the empty list).
Returns #t if v is either a pair or a syntax object
representing a pair (see syntax pair).
Returns #t if v is a list, or if it is a sequence of
pairs leading to a syntax object such that syntax->list would
produce a list.
Produces a list by flatting out a trailing syntax object using
syntax->list.
Takes the car of a syntax pair.
Takes the cdr of a syntax pair.
Returns #t if a-id and b-id are
free-identifier=?, or if a-id and b-id have
the same name (as extracted by syntax-e) and a-id
has no binding other than at the top level.
This procedure is useful in conjunction with syntax-case* to
match procedure names that are normally bound by MzScheme. For
example, the include macro uses this procedure to recognize
build-path; using free-identifier=? would not work
well outside of module, since the top-level
build-path is a distinct variable from the MzScheme export
(though it’s bound to the same procedure, initially).
1.2 Matching Fully-Expanded Expressions
A syntactic form like syntax-case*, except that the literals
are built-in as the names of the primitive PLT Scheme forms as
exported by scheme/base; see Fully Expanded Programs.
The trans?-expr boolean expression replaces the comparison
procedure, and instead selects simply between normal-phase comparisons
or transformer-phase comparisons. The clauses are the same as in
syntax-case*.
The primitive syntactic forms must have their normal bindings in the
context of the kernel-syntax-case expression. Beware that
kernel-syntax-case does not work in a module whose language
is mzscheme, since the binding of if from
mzscheme is different than the primitive if.
A syntactic form like kernel-syntax-case, except that it
takes an additional list of extra literals that are in addition to the
primitive PLT Scheme forms.
Generalizes kernel-syntax-case to work at an arbitrary phase
level, as indicated by phase-expr.
Generalizes kernel-syntax-case* to work at an arbitrary phase
level, as indicated by phase-expr.
Returns a list of identifiers that are bound normally,
for-syntax, and for-template to the primitive PLT
Scheme forms for expressions and internal-definition positions (so the
list does not include #%require or #%provide). This
function is useful for generating a list of stopping points to provide
to local-expand.
Produces a hash-table-like value for storing a mapping from syntax
identifiers to arbitrary values.
The mapping uses bound-identifier=? to compare mapping keys,
but also uses a hash table based on symbol equality to make the
mapping efficient in the common case (i.e., where non-equivalent
identifiers are derived from different symbolic names).
Returns #t if v was produced by
make-bound-identifier-mapping, #f otherwise.
Like hash-table-get for bound-identifier mappings.
Like hash-table-put! for bound-identifier mappings.
Like hash-table-for-each.
Like hash-table-map.
Produces a hash-table-like value for storing a mapping from syntax
identifiers to arbitrary values.
The mapping uses free-identifier=? to compare mapping keys,
but also uses a hash table based on symbol equality to make the
mapping efficient in the common case (i.e., where non-equivalent
identifiers are derived from different symbolic names at their
definition sites).
Returns #t if v was produced by
make-free-identifier-mapping, #f otherwise.
Like hash-table-get for free-identifier mappings.
Like hash-table-put! for free-identifier mappings.
Like hash-table-for-each.
Like hash-table-map.
The same as make-module-identifier-mapping, etc.
1.4 Rendering Syntax Objects with Formatting
Builds a string with newlines and indenting according to the source
locations in stx-list; the outer pair of parens are not
rendered from stx-list.
1.5 Computing the Free Variables of an Expression
Returns a list of free lambda- and let-bound
identifiers in expr-stx. The expression must be fully
expanded (see Fully Expanded Programs and
expand).
1.6 Stripping Lexical Context
Removes all lexical context from stx, preserving
source-location information and properties.
1.7 Legacy Zodiac Interface
The interface is similar to Zodiac – enough to be useful for
porting – but different in many ways. See the source
"zodiac-sig.ss" for details. New software should not use this
compatibility layer.