(index ("contract-helpers" 0) ("er-macro-rules" 213) ("ir-macro-rules" 606) ("bind" 987) ("bind-case" 1202) ("doclist" 1538) ("doclist->dispatcher" 1711) ("print-doclist" 2375) ("contracts" 2505) ("contract" 2697) ("define-with-contract" 3025) ("define-with-contract" 3159) ("define-with-contract" 3315) ("define-syntax-with-contract" 3540) ("define-syntax-with-contract" 3913) ("define-syntax-with-contract" 4146) ("define-macro-with-contract" 4549))
(def (sig (procedure "(contract-helpers [sym])" (id contract-helpers))) (p "prints the contract of the exported symbol sym of the contract-helpers module or the list of exported symbols when called as a thunk."))
(def (sig (syntax "(er-macro-rules (%sym ...) (code0 xpr0) (code1 xpr1) ...)" (id er-macro-rules))) (p "references a renamed version of sym ... under the name %sym ... and pairs the differnt macro-codes code0 code1 ... with expressions xpr0 xpr1 ..., which usually evalute to backquoted templates.") (p "This macro is unhygienic by design, it introduces the symbol compare? into its scope."))
(def (sig (syntax "(ir-macro-rules (sym ...) (code0 xpr0) (code1 xpr1) ...)" (id ir-macro-rules))) (p "pairs the differnt macro-codes code0 code1 ... with expressions xpr0 xpr1 ..., which usually evalute to backquoted templates in the scope of injected symbols sym ....") (p "This macro is unhygienic by design, it introduces the two symbols inject and compare? into its scope."))
(def (sig (syntax "(bind pat xpr . body)" (id bind))) (p "binds the pattern variables of the nested lambda-list pat to corresponding subexpressions of the nested pseudolist xpr and executes body in this context."))
(def (sig (syntax "(bind-case xpr (pat0 . body0) (pat1 . body1) ...)" (id bind-case))) (p "matches nested pseudolist-expression xpr against patterns pat0 pat1 ...  in sequence, binding the variables of the first matching pattern to corresponding subexpressions of xpr and executes body of the first matching pattern in this context."))
(def (sig (parameter "(doclist '())" (id doclist))) (p "should be called before the first define[-syntax]-with-contract expression to initialize automatic documentation."))
(def (sig (procedure "(doclist->dispatcher (doclist))" (id doclist->dispatcher))) (p "saves (doclist) in a dispatcher. A typical use is") (highlight scheme "(define module-name (doclist->dispatcher (doclist)))") (p "which should be called after the last define[-syntax]-with-contract expression to save the automatic documentation in module-name. This procedure can than be called by the module's client with or without a symbol argument.") (highlight scheme "(module-name [sym])") (p "Without argument the  call returns the list of exported symbols, with argument the call returns the textual representaion of the contract of the module's exported symbol sym."))
(def (sig (procedure "(print-doclist)" (id print-doclist))) (p "prints the documentation of the whole module in readable form."))
(def (sig (procedure "(contracts [sym])" (id contracts))) (p "prints the contract of the exported symbol sym of the contracts module or the list of exported symbols when called as a thunk."))
(def (sig (syntax "(contract (name . args) clause ...)" (id contract))) (p "where each clause is one of") (ul (li "a documentation string") (li (tt "(domain: assumption ...)")) (li (tt "(range: proposition ...) or (range: (with-results (res0 res1 ...) proposition ...)")) (li (tt "(effect: (state query change [equ?]) ...)"))))
(def (sig (syntax "(define-with-contract name (contract (name . args) clause ...) (lambda args . body))" (id define-with-contract))))
(def (sig (syntax "(define-with-contract name (let ((var val) ...) (contract (name . args) clause ...) (lambda args . body)))" (id define-with-contract))))
(def (sig (syntax "(define-with-contract (name . args) clause ... . body)" (id define-with-contract))) (p "where the admissible clauses are described above and instead of let another binding construct can be used as well."))
(def (sig (syntax "(define-syntax-with-contract name docstring rules)" (id define-syntax-with-contract))) (p "where rules is one of") (ul (li (tt "(syntax-rules (sym ...) (pat0 tpl0) (pat1 tpl1) ...)")) (li (tt "(ir-macro-rules (sym ...) (pat0 xpr0) (pat1 xpr1) ...)")) (li (tt "(er-macro-rules (%sym ...) (pat0 xpr0) (pat1 xpr1) ...)"))) (p "and docstring is optional,"))
(def (sig (syntax "(define-syntax-with-contract name (syntax-contract (name . rest) docstring) transformer)" (id define-syntax-with-contract))) (p "where docstring is optional and transformer is a raw low-level macro-transformer,"))
(def (sig (syntax "(define-syntax-with-contract (name . rest) docstring with-expression)" (id define-syntax-with-contract))) (p "where docstring is optional and with-expression is one of") (ul (li (tt "(literal syms . body)")) (li (tt "(with-renamed syms . body)")) (li (tt "(with-injected syms . body)"))) (p "which will be translated to syntax-rules, er-macro-rules or ir-macro-rules respectively."))
(def (sig (syntax "(define-macro-with-contract code docstring body))" (id define-macro-with-contract))) (p "where docstring is optional, code is the complete macro-code (name . args), i.e. the pattern of a macro call, and body is one of") (pre " (with-renamed (%sym ...) xpr . xprs)\n (with-injected (sym ...) xpr . xprs)\n xpr . xprs") (p "In the first case each %sym is a renamed version of sym, in the second sym is injected as is, i.e. not renamed, and in the last case no symbol is injected, i.e. the macro is hygienic."))
