(index ("macro-rules" 0) ("define-macro" 832) ("procedural-macros" 1175) ("macro-rules" 1366) ("define-macro" 2113) ("macro-let" 2483) ("macro-letrec" 2673) ("once-only" 2870) ("define-er-macro" 3079) ("define-ir-macro" 3341) ("with-mapped-symbols" 3604) ("with-gensyms" 3865))
(def (sig (syntax "(macro-rules sym ... (key ...) (pat (where fender ...) .. tpl) ....)" (id macro-rules))) (p "Note the special use of dots here and below: Three dots are ellipses, as usual, i.e. the pattern on the left is repeated zero or more times, two dots, zero or one time, 4 dots one ore several times.") (p "This form can be used instead of syntax-rules in define-syntax, let-sytax and letrec-syntax, provided, you use it for-syntax. sym ... denote the injected symbols to break hygiene (if there is none, the constructed macro is hygienic). key ... and pat .... symbols are as in syntax-rules, fender ... are pairs of pattern variables and predicates, the latter applied to the former must be true for the pattern to match, and tpl .... are usually quasiquoted expressions.") (p "And here is the syntax of define-macro"))
(def (sig (syntax "(define-macro (name . args) (where (x . xs) ...) .. xpr ....)" (id define-macro))) (p "The implementation of these macros depends on the bind-case macro of the basic-macros package which does the pattern matching of macro-rules. Since the former can handle wildcards, non-symbol literals and fenders, so does the latter."))
(def (sig (procedure "(procedural-macros sym ..)" (id procedural-macros))) (p "documentation procedure. Shows the exported symbols and the syntax of such an exported symbol, respectively."))
(def (sig (syntax "(macro-rules sym ... (keyword ...) (pat (where fender ...) .. tpl) ....)" (id macro-rules))) (p "like syntax-rules, but the templates are usually quasiquote-expressions. Moreover, the symbols sym ... are injected, if there are any. Here and in the sequel, fender is an expresseion of the form") (pre "(var ok?  ...)") (p "checking a pattern variable, var, against a sequence of predicates.") (p "Note, that non-symbol literals are accepted in each pat and considered a match if they are equal to the corresponding expression in the macro-code. The same applies to fenders: If they are not passed, the pattern is not matched.") (p "macro-rules must be used for-syntax if used in the preprocessing phase of a macro evaluation."))
(def (sig (syntax "(define-macro (name . args) (where (x . xs) ...) .. xpr ....))" (id define-macro))) (p "where xs is either a list of predicates, providing fenders, or a singleton with one of the symbols keyword or injection, providing keyword parameters or unhygienic macros. Generates a hygienic implicit-renaming macro, name, if no injection parameter is given."))
(def (sig (syntax "(macro-let (((name . args) (where fender ...) .. xpr ...) ...) body ....)" (id macro-let))) (p "evaluates body ... in the context of parallel hygienic macros name ...."))
(def (sig (syntax "(macro-letrec (((name . args) (where fender ...) .. xpr ...) ...) body ....)" (id macro-letrec))) (p "evaluates body ... in the context of recursive hygienic macros name ...."))
(def (sig (syntax "(once-only (x ...)  body ....)" (id once-only))) (p "to be used in a macro-body to avoid side-effects. The arguments x ... are only evaluated once. once-only must be imported for-syntax."))
(def (sig (syntax "(define-er-macro (name form rename-symbol compare?) xpr . xprs)" (id define-er-macro))) (p "defines an explicit-renaming-macro name with macro-code form renaming each symbol in the body xpr . xprs starting with rename-symbol automatically."))
(def (sig (syntax "(define-ir-macro (name form inject-symbol compare?) xpr . xprs)" (id define-ir-macro))) (p "defines an implicit-renaming-macro name with macro-code form injecting each symbol in the body xpr . xprs starting with inject-symbol automatically."))
(def (sig (syntax "(with-mapped-symbols mapper prefix- (prefix-x ....) xpr ....)" (id with-mapped-symbols))) (p "binds a series of prefixed names, prefix-x .... to the images of the original names, x ...., under mapper and evaluates xpr .... in this context"))
(def (sig (syntax "(with-gensyms (x ...) xpr ....)" (id with-gensyms))) (p "to be used in a macro body and hence to be imported for-syntax. Generates a list of gensyms x ... which can be used in xpr ....."))
