I just added the following to api-macros.texi:

    @subsubsection Shorthands

    One often ends up writing simple one-clause @code{syntax-rules} macros.
    There is a convenient shorthand for this idiom, in the form of
    @code{define-syntax-rule}.

    @deffn {Syntax} define-syntax-rule (keyword . pattern) [docstring] template
    Define @var{keyword} as a new @code{syntax-rules} macro with one clause.
    @end deffn

    Cast into this form, our @code{when} example is significantly shorter:

    @example
    (define-syntax-rule (when c e ...)
      (if c (begin e ...)))
    @end example

Happy hacking,

Andy
-- 
http://wingolog.org/

Reply via email to