Racket allows programmers to add new syntactic constructs in the same way that other languages permit the formulation of procedures, methods, or classes. All you need to do is formulate a simple rule that rewrites a custom syntax to a Racket expression or definition.

Little macros can particularly help programmers with DRY where other features can’t. The example on the left above shows how to define a new syntax for measuring the time a task takes. The syntax avoids the repeated use of lambda. Note also how the macro is exported from this module as if it were an ordinary function.