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

7.2 The pattern language

The syntax for <pattern> is:

<pattern> →                Matches:

  <atom>                    the <atom>.
| (kwote <atom>)            any expression eq? to <atom>.
| (and <pat1> ... <patn>)   if all of <pati> match.
| (or <pat1> ... ...<patn>) if any of <pat1> through <patn> matches.
| (not <pat>)               if <pat> doesn't match.
| (? <predicate>)           if <predicate> is true.
| (<pat1> ... <patn>)       a list of n elements. Here, ... is a
                            meta-character denoting a finite repetition
                            of patterns.
| <pat> ...                 a (possibly empty) repetition
                            of <pat> in a list.
| #(<pat> ... <patn>)       a vector of n elements.
| #{<struct> <pat> ... }    a structure.
| ?<id>                     anything, and binds id as a variable.
| ?-                        anything.
| ??-                       any (possibly empty) repetition of anything
                            in a list.
| ???-                      any end of list.

Remark: and, or, not, check and kwote must be quoted in order to be treated as literals. This is the only justification for having the kwote pattern since, by convention, any atom which is not a keyword is quoted.


This document was generated on October 23, 2011 using texi2html 5.0.

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