www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

define-expanders.scrbl (1225B)


      1 #lang scribble/manual
      2 @(require "doc-util.rkt")
      3 
      4 @title{Defining Generic Syntax Expanders}
      5 
      6 This module provides a high-level API for creating generic
      7 expanders for use with other macros.
      8 
      9 @defform[(define-expander-type id)]{
     10  Creates an expander type and binds several derived values
     11  for working with the expander type:
     12  @itemlist[
     13  @item{@code{id-expander-type} - a new unique @racket[expander-type?]
     14    bound at phase level 1}
     15  @item{@code{make-id-expander} - a procedure bound at phase level 1
     16    that accepts a transformer procedure and returns an @racket[expander?]
     17    with @code{id-expander-type}}
     18  @item{@code{id-expander?} - a predicate bound at phase level 1
     19    recognizing expanders produced by @code{make-id-expander}}
     20  @item{@code{define-id-expander} - a syntactic form at phase level
     21    0 that takes an identifier and a transformer procedure and binds the
     22    identifier as a @code{id-expander?} for use in a transformer
     23    environment}
     24  @item{@code{expand-all-id-expanders} - a procedure bound at phase
     25    @; TODO: expand-all-expanders-of-type is not documented
     26    level 1 that's equivalent to
     27    @racket[expand-syntax-tree-with-expanders-of-type] with the
     28    @code{id-expander-type} as the type argument}
     29  ]}