[ANN] Rematch.jl

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
16 Likes

Out of curiosity, what is “CodeTools” and how does that help? Thanks! – Adam

I think they meant MacroTools, not CodeTools.

That makes sense. Thanks!

Ooops.

I typed CodeTools too many times today and it’s etched on my brain :slight_smile: