You are looking at historical revision 32807 of this page. It may differ significantly from its current revision.

Outdated egg!

This is an egg for CHICKEN 3, the unsupported old release. You're almost certainly looking for the CHICKEN 4 version of this egg, if it exists.

If it does not exist, there may be equivalent functionality provided by another egg; have a look at the egg index. Otherwise, please consider porting this egg to the current version of CHICKEN.

Introduction

Matchable is a drop-in compatible replacement for Chicken's MATCH macro. All forms are provided under the same name, and all features except the ..k pattern are supported.

In addition, matchable supports non-linear patterns, i.e. patterns where an identifier occurs multiple times, requiring all instances of the identifier to be EQUAL?. For example:

 (x _ x)

matches all lists of three elements whose first and third elements are the same.

For full documentation, see Pattern matching. However, the match-error-control and match-error-procedure procedures have no impact. A failure to match always signals an error.

Requirements

Any syntax-rules implementation, such as syntax-case, syntactic-closures, riaxpander or alexpander.

License

public domain

Download

http://code.call-cc.org/legacy-eggs/3/matchable.egg

History

2.4
fixing bug where (a ...) matched non-lists
2.3
allowing `...' with any backend, removing redundant check in vector patterns
2.2
uses srfi-46, if available (as it is in alexpander)
2.1
fixing quasiquote patterns
2.0
allowing ellipse patterns in other than the final position of a list
1.41
added syntax-error macro & specialized for Chicken [Kon Lovett]
1.3
updated to change in syntactic-closures 0.91
1.2
bugfix, now all tests pass with syntactic-closures
1.1
works now with syntactic-closures
1.0
initial release