-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Erlang matchspecs are composed of tuple functions of 3 parts:
MatchFunction ::= { MatchHead, MatchConditions, MatchBody }
Usually literal values will be interpreted "as is" on the head or body with the exception of tuples and records on the MatchBody, as the engine requires those to be wrapped in a single element tuple.
Examples
To represent the tuple #(1, 2, 3) we will require:
let body = #(#(1, 2, 3))To represent the record User(name: "Raúl") we will require:
let body = #(#(tag("user"), "Raúl"))Instead of having the user specifying double tuples everywhere in the body we could automate it, can be done for primitives but the hard part is how to solve for custom datastructures.
This is partially implemented in v0.4.1.
Metadata
Metadata
Assignees
Labels
No labels