pmatch

  1. pmatch
    1. Description
    2. Author
    3. Requirements
    4. Download
    5. Documentation
    6. License

Description

Macroless ML-style pattern matching.

Author

Mayer Goldberg. Packaged as a Chicken extension by Category 5.

Requirements

None

Download

pmatch.egg

Documentation

In the words of the author:

 This pattern matcher implements ML-style pattern matching in Scheme
 relatively painlessly. I use it whenever I need to name various
 sub-expressions of some sexpr, and refer to them by those names. The
 package is built on the two procedures 'with' and
 'match'. The 'with' procedure has been one of my favourite
 Scheme idioms for quite a while, and you can certainly use it apart [from] any
 pattern matching. The 'match' procedure is a recent addition to the
 bag-o'-tricks.

The only change made to the author's original code is the renaming of the match procedure to pmatch to avoid conflict with Chicken's built-in match.

The following procedures are provided:

[procedure] pmatch
[procedure] map-match
[procedure] ?
[procedure] with
[procedure] match-struct
[procedure] compose-match
[procedure] compose-match-list

Please see the author's documentation for more information.

License

This code is in the public domain