Skip to content
Chris Petersen edited this page Oct 16, 2014 · 1 revision

define-syntax defines name as a macro special form, whose expansion is specified in the expander.

Parameter Description
name Macro name
expander Macro expander

Example

Example 1: Example from Gambit

> (define-syntax unless
    (syntax-rules ()
      ((unless test body ...)
       (if test #f (begin body ...)))))
> (unless (fx= 0 1) (display "Hi\n"))
Hi
Clone this wiki locally