The syntax for return expressions is very limited. Below are two tiny examples.
Issue #8 has a bigger example where the choreography ends with an if/else. It wants to return a value in one branch (fine) and loop in the other branch (error).
[ ] return value ==> ProjectionError
defmodule TestChor do
defchor [Buyer, Seller] do
Buyer.get_book_title() ~> Seller.(b)
Seller.get_price("book:" <> b) ~> Buyer.(p)
0 # ** (Chorex.ProjectionError) Unrecognized code: 0
end
end
[ ] function call ==> MatchError
defmodule TestChor do
def double(n), do: n + n
defchor [Buyer, Seller] do
Buyer.get_book_title() ~> Seller.(b)
Seller.get_price("book:" <> b) ~> Buyer.(p)
double(3) # ** (MatchError) no match of right hand side value: 3
end
end
The syntax for return expressions is very limited. Below are two tiny examples.
Issue #8 has a bigger example where the choreography ends with an if/else. It wants to return a value in one branch (fine) and loop in the other branch (error).