Add match expressions a la Rust to Asteroid,
let p = (1,2).
let x = (match p
with (x,y) if x > y do
"GT"
with (x,y) if x < y do
"LT"
with _ do
throw Error("not a valid tuple"))
assert(x =="LT").
Since it is an expression it does not have an end keyword, the end keyword would look really weird in expressions, but therefore this expression is syntactically very ambiguous similarly to lambda functions and needs to be surrounded by parens in most cases.
Add match expressions a la Rust to Asteroid,
Since it is an expression it does not have an
endkeyword, theendkeyword would look really weird in expressions, but therefore this expression is syntactically very ambiguous similarly to lambda functions and needs to be surrounded by parens in most cases.