You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 text was updated successfully, but these errors were encountered:
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).
The text was updated successfully, but these errors were encountered: