manpagez: man pages & more
info guile
Home | html | info | man
[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.10.2.3 Shorthands

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

Syntax: define-syntax-rule (keyword . pattern) [docstring] template

Define keyword as a new syntax-rules macro with one clause.

Cast into this form, our when example is significantly shorter:

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

This document was generated on February 3, 2012 using texi2html 5.0.

© manpagez.com 2000-2024
Individual documents may contain additional copyright information.