Need help with Match.jl?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.
kmsquire

Description

Advanced Pattern Matching for Julia

145 Stars 23 Forks Other 137 Commits 20 Opened issues

Services available

Need anything else?

Travis Build Status Appveyor Build Status Test Coverage PkgEval.jl Status on Julia 0.5 PkgEval.jl Status on Julia 0.6 Documentation Status

Advanced Pattern Matching for Julia

Features:

  • Matching against almost any data type with a first-match policy
  • Deep matching within data types and matrices
  • Variable binding within matches

For alternatives to

Match
, check out

Installation

Use the Julia package manager. Within Julia, do:

julia
Pkg.add("Match")

Usage

The package provides one macro,

@match
, which can be used as:
using Match

@match item begin pattern1 => result1 pattern2, if cond end => result2 pattern3 || pattern4 => result3 _ => default_result end

It is possible to supply variables inside pattern, which will be bound to corresponding values.

See the documentation for examples of this and other features.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.