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.

About the developer

kmsquire
154 Stars 23 Forks Other 137 Commits 22 Opened issues

Description

Advanced Pattern Matching for Julia

Services available

!
?

Need anything else?

Contributors list

# 23,034
The Jul...
julia-l...
hpc
data-fr...
105 commits
# 64,294
delauna...
rad
cpp17
ecs-fra...
2 commits
# 662,585
Python
HTML
account...
Django
2 commits
# 289,079
The Jul...
calculu...
Jupyter...
Shell
1 commit
# 40,118
Jupyter...
tikz
TeX
The Jul...
1 commit
# 244,078
jupyter
The Jul...
Shell
TeX
1 commit
# 45,302
Jupyter...
The Jul...
calculu...
Shell
1 commit

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.