Version: 4.2
6.7 Extending the Syntax of Signatures
Binds sig-form-id for use within a define-signature
form.
In the first form, the result of expr must be a transformer
procedure. In the second form, sig-form-id is bound to a
transformer procedure whose argument is id and whose body is
the bodys. The result of the transformer must be a list of
syntax objects, which are substituted for a use of
sig-form-id in a define-signature expansion. (The
result is a list so that the transformer can produce multiple
declarations; define-signature has no splicing begin
form.)}
(struct id (field ...) option ...) |
|
field | | = | | id | | | | | | [id #:mutable] | | | | | | option | | = | | #:mutable | | | | | | #:omit-constructor | | | | | | #:omit-define-syntaxes | | | | | | #:omit-define-values |
|
For use with define-signature. The expansion of a
struct signature form includes all of the identifiers that
would be bound by (define-struct id (field ...) option ...),
where the extra option #:omit-constructor omits the
make-id identifier.
(struct/ctc id ([field contract-expr] ...) option ...) |
|
field | | = | | id | | | | | | [id #:mutable] | | | | | | option | | = | | #:mutable | | | | | | #:omit-constructor | | | | | | #:omit-define-syntaxes | | | | | | #:omit-define-values |
|
For use with define-signature. The struct/ctc form works
similarly to struct, but the constructor, predicate, field
accessors, and field mutators are contracted appropriately.