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

Ellipses in Patterns

As in syntax-rules, ellipses may be used to specify a repeated pattern. Note that the pattern item ... specifies zero-or-more matches of the pattern item.

The use of ellipses in a pattern is illustrated in the code fragment below, where nested ellipses are used to match the children of repeated instances of an a element, within an element d.

(define x '(d (a 1 2 3) (a 4 5) (a 6 7 8) (a 9 10)))

(sxml-match x
  [(d (a ,b ...) ...)
   (list (list b ...) ...)])

The above expression returns a value of ((1 2 3) (4 5) (6 7 8) (9 10)).


This document was generated on April 20, 2013 using texi2html 5.0.

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