Warning: This is the manual of the legacy Guile 2.0 series. You may want to read the manual of the current stable series instead.

Next: , Previous: , Up: R6RS Standard Libraries   [Contents][Index]


7.6.2.22 rnrs syntax-case

The (rnrs syntax-case (6)) library provides access to the syntax-case system for writing hygienic macros. With one exception, all of the forms and procedures exported by this library are “re-exports” of Guile’s native support for syntax-case; See Syntax Case, for documentation, examples, and rationale.

Scheme Procedure: make-variable-transformer proc

Creates a new variable transformer out of proc, a procedure that takes a syntax object as input and returns a syntax object. If an identifier to which the result of this procedure is bound appears on the left-hand side of a set! expression, proc will be called with a syntax object representing the entire set! expression, and its return value will replace that set! expression.

Scheme Syntax: syntax-case expression (literal ...) clause ...

The syntax-case pattern matching form.

Scheme Syntax: syntax template
Scheme Syntax: quasisyntax template
Scheme Syntax: unsyntax template
Scheme Syntax: unsyntax-splicing template

These forms allow references to be made in the body of a syntax-case output expression subform to datum and non-datum values. They are identical to the forms provided by Guile’s core library; See Syntax Case, for documentation.

Scheme Procedure: identifier? obj
Scheme Procedure: bound-identifier=? id1 id2
Scheme Procedure: free-identifier=? id1 id2

These predicate procedures operate on syntax objects representing Scheme identifiers. identifier? returns #t if obj represents an identifier, #f otherwise. bound-identifier=? returns #t if and only if a binding for id1 would capture a reference to id2 in the transformer’s output, or vice-versa. free-identifier=? returns #t if and only id1 and id2 would refer to the same binding in the output of the transformer, independent of any bindings introduced by the transformer.

Scheme Procedure: generate-temporaries l

Returns a list, of the same length as l, which must be a list or a syntax object representing a list, of globally unique symbols.

Scheme Procedure: syntax->datum syntax-object
Scheme Procedure: datum->syntax template-id datum

These procedures convert wrapped syntax objects to and from Scheme datum values. The syntax object returned by datum->syntax shares contextual information with the syntax object template-id.

Scheme Procedure: syntax-violation whom message form
Scheme Procedure: syntax-violation whom message form subform

Constructs a new compound condition that includes the following simple conditions:


Next: , Previous: , Up: R6RS Standard Libraries   [Contents][Index]