Rematch.jl provides a macro for pattern matching.
Rematch started life as a series of PRs to Match.jl but eventually we reached the point where many of the features we wanted required breaking backwards compatibility and it was easier to just start from scratch. Rematch is mostly backwards-compatible but:
- is much stricter about matching
- fixes many of the outstanding issues in Match.jl
- use the same pattern matching algorithm for all patterns, rather than switching to
==
for simple patterns, thus avoiding some tricky edge cases where adding a variable to a pattern could change the matching semantics - generates more type-stable code
- is much easier to maintain, thanks to MacroTools