Skip to main content

Pattern Matching

Pattern matching involves comparing a value or data structure against a pattern and extracting relevant parts of the data if the match is successful.

For the sake of this language, Pattern matching is used for the purpose of declaring multiple variables using tuples or lists

The pattern matching is done with the match operator =

> {x, y} = {1, 2}
> print(x)
1
> print(y)
2